deleteChatPhoto method

Future<bool> deleteChatPhoto(
  1. dynamic chatId
)

Use this method to delete a chat photo

Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

Returns True on success.

Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is off in the target group.

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

Implementation

Future<bool> deleteChatPhoto(dynamic chatId) 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('deleteChatPhoto');
  var body = <String, dynamic>{'chat_id': chatId};
  return await HttpClient.httpPost(requestUrl, body: body);
}