Command update.

For some reason, the admin scope commands are not showing up to
administrators.
This commit is contained in:
Benjamin A. Shelton 2026-10-19 23:15:12 -06:00
commit b5593475c6
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01

View file

@ -126,6 +126,11 @@ func (b *bot) SetCommands(ctx context.Context) (err error) {
fmt.Println(commands)
if len(commands) > 0 {
if b.settings.Debug.Commands.Reset || b.settings.Debug.Commands.Clear {
b.tgbot.DeleteMyCommands(ctx, &telego.DeleteMyCommandsParams{
Scope: &telego.BotCommandScopeAllChatAdministrators{
Type: "all_chat_administrators",
},
})
b.tgbot.DeleteMyCommands(ctx, &telego.DeleteMyCommandsParams{})
}
for _, command := range commands {
@ -137,12 +142,10 @@ func (b *bot) SetCommands(ctx context.Context) (err error) {
return
}
b.tgbot.SetMyCommands(ctx, &telego.SetMyCommandsParams{
Scope: &telego.BotCommandScopeAllChatAdministrators{
Type: "all_chat_administrators",
},
Commands: []telego.BotCommand{
{
Command: "help",
Description: "Displays bot usage and help.",
IsEphemeral: true,
},
{
Command: "settings",
Description: "Bot settings.",
@ -153,6 +156,15 @@ func (b *bot) SetCommands(ctx context.Context) (err error) {
Description: "Starts the bot and links it to the current user's channel.",
IsEphemeral: true,
},
},
})
b.tgbot.SetMyCommands(ctx, &telego.SetMyCommandsParams{
Commands: []telego.BotCommand{
{
Command: "help",
Description: "Displays bot usage and help.",
IsEphemeral: true,
},
{
Command: "announce",
Description: "Adds an announcement to the bot.",