setChatMenuButton method

Future<bool> setChatMenuButton(
  1. int? chatId,
  2. MenuButton? menuButton
)

Use this method to change the bot's menu button in a private chat, or the default menu button.

Returns True on success.

https://core.telegram.org/bots/api#setchatmenubutton

Implementation

Future<bool> setChatMenuButton(int? chatId, MenuButton? menuButton) async {
  var requestUrl = _apiUri('setChatMenuButton');
  var body = <String, dynamic>{
    'chat_id': chatId,
    'menu_button': jsonEncode(menuButton),
  };
  return await HttpClient.httpPost(requestUrl, body: body);
}