setMyDefaultAdministratorRights method

Future<bool> setMyDefaultAdministratorRights(
  1. ChatAdministratorRights? rights,
  2. bool? forChannels
)

Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot.

Returns True on success.

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

Implementation

Future<bool> setMyDefaultAdministratorRights(
    ChatAdministratorRights? rights, bool? forChannels) async {
  var requestUrl = _apiUri('setMyDefaultAdministratorRights');
  var body = <String, dynamic>{
    'rights': rights == null ? null : jsonEncode(rights),
    'for_channels': forChannels,
  };
  return await HttpClient.httpPost(requestUrl, body: body);
}