Skip to main content

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

NameTypeRequiredDescription
UserIDInputUserClassyesUser ID
ButtonBotMenuButtonClassyesBot menu button action

Returns

bool

Possible errors

CodeTypeDescription
400BUTTON_INVALIDThe specified button is invalid.
400BUTTON_TEXT_INVALIDThe specified button text is invalid.
400BUTTON_URL_INVALIDButton URL invalid.
400USER_BOT_REQUIREDThis method can only be called by a bot.

References