sendSticker method
Future<Message>
sendSticker(
- ID chatId,
- InputFile sticker, {
- String? businessConnectionId,
- int? messageThreadId,
- String? emoji,
- bool? disableNotification,
- bool? protectContent,
- bool? allowPaidBroadcast,
- String? messageEffectId,
- ReplyParameters? replyParameters,
- ReplyMarkup? replyMarkup,
- int? directMessagesTopicId,
- SuggestedPostParameters? suggestedPostParameters,
Sends static .WEBP, animated .TGS, or video .WEBM stickers.
On success, the sent Message is returned.
Implementation
Future<Message> sendSticker(
ID chatId,
InputFile sticker, {
String? businessConnectionId,
int? messageThreadId,
String? emoji,
bool? disableNotification,
bool? protectContent,
bool? allowPaidBroadcast,
String? messageEffectId,
ReplyParameters? replyParameters,
ReplyMarkup? replyMarkup,
int? directMessagesTopicId,
SuggestedPostParameters? suggestedPostParameters,
}) async {
final params = <String, dynamic>{
'chat_id': chatId,
'sticker': sticker,
'business_connection_id': ?businessConnectionId,
'message_thread_id': ?messageThreadId,
'emoji': ?emoji,
'disable_notification': ?disableNotification,
'protect_content': ?protectContent,
'allow_paid_broadcast': ?allowPaidBroadcast,
'message_effect_id': ?messageEffectId,
'reply_parameters': ?replyParameters,
'reply_markup': ?replyMarkup,
'direct_messages_topic_id': ?directMessagesTopicId,
'suggested_post_parameters': ?suggestedPostParameters,
};
final files = _prepareFiles([('sticker', sticker)]);
final payload = Payload(params, files);
final response = await _makeRequest<Map<String, dynamic>>(
APIMethod.sendSticker.name,
payload,
);
return Message.fromJson(response);
}