replyWithSticker method

Future<Message> replyWithSticker(
  1. InputFile sticker, {
  2. String? businessConnectionId,
  3. int? messageThreadId,
  4. String? emoji,
  5. bool? disableNotification,
  6. bool? protectContent,
  7. bool? allowPaidBroadcast,
  8. String? messageEffectId,
  9. ReplyParameters? replyParameters,
  10. ReplyMarkup? replyMarkup,
  11. int? directMessagesTopicId,
  12. 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,
  );
}