setChatDescription method

Future<bool> setChatDescription(
  1. dynamic chatId, {
  2. String? description,
})

Use this method to change the description of a supergroup or a channel

The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

Returns True on success.

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

Implementation

Future<bool> setChatDescription(dynamic chatId, {String? description}) async {
  if (chatId is! String && chatId is! int) {
    return Future.error(TelegramException(
        'Attribute \'chatId\' can only be either type of String or int'));
  }
  var requestUrl = _apiUri('setChatDescription');
  var body = <String, dynamic>{
    'chat_id': chatId,
    'description': description,
  };
  return await HttpClient.httpPost(requestUrl, body: body);
}