20 lines
374 B
Go

package commands
import tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
type Command interface {
Name() string
Help() string
Execute(update tgbotapi.Update, bot *tgbotapi.BotAPI)
}
var commandRegistry = make(map[string]Command)
func Register(cmd Command) {
commandRegistry[cmd.Name()] = cmd
}
func All() map[string]Command {
return commandRegistry
}