Refine Telegram thread commands

This commit is contained in:
Codex
2026-06-23 11:19:48 +00:00
parent ac8d5c2803
commit 595e8aee0e
9 changed files with 628 additions and 102 deletions

View File

@@ -52,7 +52,13 @@ func (c *Client) redact(text string) string {
func (c *Client) SetMyCommands(ctx context.Context, commands []BotCommand) error {
var ok bool
return c.postJSON(ctx, "setMyCommands", map[string]any{"commands": commands}, &ok)
if err := c.postJSON(ctx, "setMyCommands", map[string]any{"commands": commands}, &ok); err != nil {
return err
}
return c.postJSON(ctx, "setMyCommands", map[string]any{
"commands": commands,
"scope": map[string]any{"type": "all_private_chats"},
}, &ok)
}
func (c *Client) GetUpdates(ctx context.Context, offset int, timeoutSeconds int) ([]Update, error) {