replyWithRichMessage method

Future<Message> replyWithRichMessage(
  1. InputRichMessage richMessage, {
  2. int? messageThreadId,
  3. bool? disableNotification,
  4. bool? protectContent,
  5. ReplyMarkup? replyMarkup,
  6. ReplyParameters? replyParameters,
  7. String? businessConnectionId,
  8. String? messageEffectId,
  9. bool? allowPaidBroadcast,
  10. int? directMessagesTopicId,
  11. EphemeralMessageParameters? ephemeralMessageParameters,
  12. SuggestedPostParameters? suggestedPostParameters,
})

Sends a rich message to the current chat.

This is a convenience method that sends a rich formatted message to the same chat where the current update originated from. If the message contains a block with a media element, then the bot must have the right to send the media to the chat.

Example:

await ctx.replyWithRichMessage(
  InputRichMessage(markdown: '# Report\n\nEverything is **fine**.'),
);

Implementation

Future<Message> replyWithRichMessage(
  InputRichMessage richMessage, {
  int? messageThreadId,
  bool? disableNotification,
  bool? protectContent,
  ReplyMarkup? replyMarkup,
  ReplyParameters? replyParameters,
  String? businessConnectionId,
  String? messageEffectId,
  bool? allowPaidBroadcast,
  int? directMessagesTopicId,
  EphemeralMessageParameters? ephemeralMessageParameters,
  SuggestedPostParameters? suggestedPostParameters,
}) async {
  final chatId = _getChatId();
  _verifyInfo([chatId], APIMethod.sendRichMessage);

  return api.sendRichMessage(
    chatId!,
    richMessage,
    messageThreadId: _threadId(messageThreadId),
    disableNotification: disableNotification,
    protectContent: protectContent,
    replyMarkup: replyMarkup,
    replyParameters: replyParameters,
    businessConnectionId: _businessConnectionId(businessConnectionId),
    messageEffectId: messageEffectId,
    allowPaidBroadcast: allowPaidBroadcast,
    directMessagesTopicId: directMessagesTopicId,
    ephemeralMessageParameters: ephemeralMessageParameters,
    suggestedPostParameters: suggestedPostParameters,
  );
}