Command update.
For some reason, the admin scope commands are not showing up to administrators.
This commit is contained in:
parent
2c2d6af7eb
commit
b5593475c6
1 changed files with 17 additions and 5 deletions
|
|
@ -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.",
|
||||
|
|
|
|||
Loading…
Reference in a new issue