setChatStickerSet method

Future<bool> setChatStickerSet(
  1. dynamic chatId,
  2. String stickerSetName
)

Use this method to set a group sticker set for a supergroup

The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field canSetStickerSet optionally returned in getChat requests to check if the bot can use this method.

Returns True on success.

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

Implementation

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