group_helper/telegram/routines/command.go
2020-05-09 20:54:42 +02:00

23 lines
606 B
Go

package routines
import (
"git.dragon-labs.de/alphyron/group_helper/cli"
"git.dragon-labs.de/alphyron/group_helper/models"
"git.dragon-labs.de/alphyron/group_helper/telegram"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
)
type commandRoutine struct {
CommandManager *cli.CommandManager
}
func NewCommandRoutine(commandManager *cli.CommandManager) telegram.Routine {
return &commandRoutine{CommandManager: commandManager}
}
func (cr commandRoutine) Update(update *tgbotapi.Update, group *models.Group) error {
_, err := cr.CommandManager.ExecuteUpdate(update, group)
return err
}