replyWithSticker method
Future<Message>
replyWithSticker(
- 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 a sticker to the current chat.
This method sends a sticker file (WebP, WEBM video, or TGS animated sticker). The sticker can be uploaded as a new file or referenced by file ID or URL. All parameters from the RawAPI.sendSticker method are supported.
Example:
final sticker = InputFile.fromFile(File('sticker.webp'));
await ctx.replyWithSticker(sticker);
// From file ID with emoji
final sticker = InputFile.fromFileId('CAACAgIAAxkBAAI...');
await ctx.replyWithSticker(
sticker,
emoji: '😀',
messageThreadId: 123,
);
Implementation
Future<Message> replyWithSticker(
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 chatId = _getChatId();
_verifyInfo([chatId], APIMethod.sendSticker);
return api.sendSticker(
chatId!,
sticker,
businessConnectionId: _businessConnectionId(businessConnectionId),
messageThreadId: _threadId(messageThreadId),
emoji: emoji,
disableNotification: disableNotification,
protectContent: protectContent,
allowPaidBroadcast: allowPaidBroadcast,
messageEffectId: messageEffectId,
replyParameters: replyParameters,
replyMarkup: replyMarkup,
directMessagesTopicId: directMessagesTopicId,
suggestedPostParameters: suggestedPostParameters,
);
}