diff --git a/cmd/bot/main.go b/cmd/bot/main.go index 3afc0bd..72df34d 100644 --- a/cmd/bot/main.go +++ b/cmd/bot/main.go @@ -103,6 +103,7 @@ func NewBot() (bot *Bot, errch chan error, err error) { } bot.AttachHandlers() + bot.SetCommands(ctx) return } @@ -151,6 +152,47 @@ func (b *Bot) SendScripture() { }*/ } +func (b *Bot) SetCommands(ctx context.Context) (err error) { + commands, err := b.Bot.GetMyCommands(ctx, &telego.GetMyCommandsParams{}) + fmt.Println(commands) + if len(commands) > 0 { + return + } + b.Bot.SetMyCommands(ctx, &telego.SetMyCommandsParams{ + Commands: []telego.BotCommand{ + { + Command: "help", + Description: "Displays bot usage and help.", + IsEphemeral: true, + }, + { + Command: "settings", + Description: "Bot settings.", + IsEphemeral: true, + }, + { + Command: "start", + Description: "Starts the bot and links it to the current user's channel.", + IsEphemeral: true, + }, + { + Command: "verse", + Description: "Looks up a Bible passage. Optionally accepts a translation identifier as its second argument.", + }, + { + Command: "random", + Description: "Submits a random Bible passage to the current chat.", + }, + { + Command: "add", + Description: "Submits a passage to the bot's daily passage rotation.", + IsEphemeral: true, + }, + }, + }) + return +} + func (b *Bot) SetPolling(ctx context.Context, conf *settings.Settings) (err error) { err = b.Bot.DeleteWebhook(ctx, &telego.DeleteWebhookParams{