vegapokerbot/internal/handler/wizard/unknown_command.go

29 lines
723 B
Go
Raw Normal View History

package wizard
import (
"gitea.neur0tx.site/Neur0toxine/vegapokerbot/internal/handler/iface"
"github.com/mymmrac/telego"
tu "github.com/mymmrac/telego/telegoutil"
"strings"
)
type UnknownCommand struct {
iface.Base
}
func NewUnknownCommand(app iface.App, userID, chatID int64) *UnknownCommand {
return &UnknownCommand{iface.NewBase(app, userID, chatID)}
}
func (h *UnknownCommand) Handle(wh telego.Update) error {
if !strings.HasPrefix(wh.Message.Text, "/") {
return nil
}
_, err := h.App.TG().SendMessage(&telego.SendMessageParams{
ChatID: tu.ID(wh.Message.Chat.ID),
2024-05-09 23:26:21 +03:00
Text: h.Localizer(wh.Message.From.LanguageCode).Message("unknown_command"),
ParseMode: telego.ModeMarkdown,
})
return err
}