copyHere method

Future<MessageId> copyHere({
  1. int? messageThreadId,
  2. String? caption,
  3. ParseMode? parseMode,
  4. List<MessageEntity>? captionEntities,
  5. bool? disableNotification,
  6. bool? protectContent,
  7. ReplyMarkup? replyMarkup,
  8. ReplyParameters? replyParameters,
  9. bool? showCaptionAboveMedia,
  10. bool? allowPaidBroadcast,
  11. int? videoStartTimestamp,
  12. int? directMessagesTopicId,
  13. 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,
  );
}