replyWithRichMessage method
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,
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,
);
}