bots.setBotMenuButton
Sets the menu button action » for a given user or for all users
func (c *Client) BotsSetBotMenuButton(ctx context.Context, request *BotsSetBotMenuButtonRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.BotsSetBotMenuButton(ctx, &tg.BotsSetBotMenuButtonRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
UserID | InputUserClass | yes | User ID |
Button | BotMenuButtonClass | yes | Bot menu button action |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | BUTTON_INVALID | The specified button is invalid. |
| 400 | BUTTON_TEXT_INVALID | The specified button text is invalid. |
| 400 | BUTTON_URL_INVALID | Button URL invalid. |
| 400 | USER_BOT_REQUIRED | This method can only be called by a bot. |
References
- Official documentation
- Generated Go reference
- TL definition:
bots.setBotMenuButton#4504d54f