setChatStickerSet method

Future<bool> setChatStickerSet(
  1. dynamic chat_id,
  2. String sticker_set_name
)
inherited

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