copyMessage method

Future<MessageId> copyMessage(
  1. ChatID chatId,
  2. ChatID fromChatId,
  3. int messageId, {
  4. String? caption,
  5. ParseMode? parseMode,
  6. List<MessageEntity>? captionEntities,
  7. bool? disableNotification,
  8. bool? protectContent,
  9. int? replyToMessageId,
  10. bool? allowSendingWithoutReply,
  11. ReplyMarkup? replyMarkup,
})
inherited

Use this method to copy messages of any kind.

Service messages and invoice messages can't be copied.

The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message.

Returns the MessageId of the sent message on success.

Implementation

Future<MessageId> copyMessage(
  ChatID chatId,
  ChatID fromChatId,
  int messageId, {
  String? caption,
  ParseMode? parseMode,
  List<MessageEntity>? captionEntities,
  bool? disableNotification,
  bool? protectContent,
  int? replyToMessageId,
  bool? allowSendingWithoutReply,
  ReplyMarkup? replyMarkup,
}) {
  return _client.apiCall(_token, 'copyMessage', {
    'chat_id': chatId,
    'from_chat_id': fromChatId,
    'message_id': messageId,
    'caption': caption,
    'parse_mode': parseMode,
    'caption_entities': captionEntities,
    'disable_notification': disableNotification,
    'protect_content': protectContent,
    'reply_to_message_id': replyToMessageId,
    'allow_sending_without_reply': allowSendingWithoutReply,
    'reply_markup': replyMarkup,
  });
}