Skip to main content

bots.getBotMenuButton

Gets the menu button action for a given user or for all users, previously set using bots.setBotMenuButton; users can see this information in the botInfo constructor.

func (c *Client) BotsGetBotMenuButton(ctx context.Context, userid InputUserClass) (BotMenuButtonClass, error)

Calling this method​

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.BotsGetBotMenuButton(ctx, userid)
if err != nil {
return err
}
_ = res // BotMenuButtonClass
return nil
})

Parameters​

NameTypeRequiredDescription
UserIDInputUserClassyesUser ID or empty for the default menu button.

Returns​

BotMenuButtonClass

Possible errors​

CodeTypeDescription
400USER_BOT_REQUIREDThis method can only be called by a bot.

References​