copyHere method
Future<MessageId>
copyHere({
- int? messageThreadId,
- String? caption,
- ParseMode? parseMode,
- List<
MessageEntity> ? captionEntities, - bool? disableNotification,
- bool? protectContent,
- ReplyMarkup? replyMarkup,
- ReplyParameters? replyParameters,
- bool? showCaptionAboveMedia,
- bool? allowPaidBroadcast,
- int? videoStartTimestamp,
- int? directMessagesTopicId,
- SuggestedPostParameters? suggestedPostParameters,
Copies the current message to the same chat with modifications.
This is a convenience method that copies the current message to the same chat it was sent from, allowing you to modify the content.
Example:
// Copy with a new caption
await ctx.copyHere(caption: 'Modified version');
Implementation
Future<MessageId> copyHere({
int? messageThreadId,
String? caption,
ParseMode? parseMode,
List<MessageEntity>? captionEntities,
bool? disableNotification,
bool? protectContent,
ReplyMarkup? replyMarkup,
ReplyParameters? replyParameters,
bool? showCaptionAboveMedia,
bool? allowPaidBroadcast,
int? videoStartTimestamp,
int? directMessagesTopicId,
SuggestedPostParameters? suggestedPostParameters,
}) async {
final chatId = _getChatId();
_verifyInfo(
[chatId],
APIMethod.copyMessage,
description: "No chat information found in the current update.",
);
return copyMessage(
chatId!,
messageThreadId: _threadId(messageThreadId),
caption: caption,
parseMode: parseMode,
captionEntities: captionEntities,
disableNotification: disableNotification,
protectContent: protectContent,
replyMarkup: replyMarkup,
replyParameters: replyParameters,
showCaptionAboveMedia: showCaptionAboveMedia,
allowPaidBroadcast: allowPaidBroadcast,
videoStartTimestamp: videoStartTimestamp,
directMessagesTopicId: directMessagesTopicId,
suggestedPostParameters: suggestedPostParameters,
);
}