unpinAllChatMessages method

Future<bool> unpinAllChatMessages(
  1. dynamic chat_id
)
inherited

Use this method to clear the list of pinned messages in a chat

If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel.

Returns True on success.

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

Implementation

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