From 22e786f102e84bec021f8ea48d0d821f2cd4a204 Mon Sep 17 00:00:00 2001 From: wolfsilver Date: Fri, 30 Aug 2024 17:52:50 +0800 Subject: [PATCH] feat: set bot commands (#54) --- memogram.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/memogram.go b/memogram.go index 9632b0e..4067193 100644 --- a/memogram.go +++ b/memogram.go @@ -73,6 +73,23 @@ func (s *Service) Start(ctx context.Context) { return } slog.Info("workspace profile", slog.Any("profile", workspaceProfile)) + + // set bot commands + commands := []models.BotCommand{ + { + Command: "start", + Description: "Start the bot with access token", + }, + { + Command: "search", + Description: "Search for the memos", + }, + } + _, err = s.bot.SetMyCommands(ctx, &bot.SetMyCommandsParams{Commands: commands}) + if err != nil { + slog.Error("failed to set bot commands", slog.Any("err", err)) + } + s.bot.Start(ctx) }