createNewStickerSet method
Use this method to create sticker set owned by a user
The bot will be able to edit the created sticker set. You must use exactly one of the fields pngSticker, tgsSticker, or webmSticker.
Returns True on success.
Implementation
Future<bool> createNewStickerSet(int userId, String name, String title,
List<InputSticker> stickers, String stickerFormat,
{String? stickerType, bool? needsRepainting}) async {
var requestUrl = _apiUri('createNewStickerSet');
var botInfo = await getMe();
var body = <String, dynamic>{
'user_id': userId,
'name': '${name}_by_${botInfo.username}',
'title': title,
'stickers': jsonEncode(stickers),
'sticker_format': stickerFormat,
'sticker_type': stickerType,
'needs_repainting': needsRepainting,
};
List<MultipartFile> stickerFiles = stickers
.map((it) => it.stickerFile)
.whereType<MultipartFile>()
.toList();
if (stickerFiles.isNotEmpty) {
return await HttpClient.httpMultipartPost(requestUrl, stickerFiles,
body: body);
} else {
return await HttpClient.httpPost(requestUrl, body: body);
}
}