messages.ForwardMessages

class pyrogram.raw.functions.messages.ForwardMessages

Forwards messages by their IDs.

Details:
  • Layer: 227

  • ID: 13704A7C

Parameters:
  • from_peer (InputPeer) – Source of messages

  • id (List of int 32-bit) – IDs of messages

  • random_id (List of int 64-bit) – Random ID to prevent resending of messages

  • to_peer (InputPeer) – Destination peer

  • silent (bool, optional) – Whether to send messages silently (no notification will be triggered on the destination clients)

  • background (bool, optional) – Whether to send the message in background

  • with_my_score (bool, optional) – When forwarding games, whether to include your score in the game

  • drop_author (bool, optional) – Whether to forward messages without quoting the original author

  • drop_media_captions (bool, optional) – Whether to strip captions from media

  • noforwards (bool, optional) – Only for bots, disallows further re-forwarding and saving of the messages, even if the destination chat doesn’t have content protection enabled

  • allow_paid_floodskip (bool, optional) – Bots only: if set, allows sending up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot’s balance.

  • top_msg_id (int 32-bit, optional) – Destination forum topic

  • reply_to (InputReplyTo, optional) – Can only contain an inputReplyToMonoForum, to forward messages to a monoforum topic (mutually exclusive with top_msg_id).

  • schedule_date (int 32-bit, optional) – Scheduled message date for scheduled messages

  • schedule_repeat_period (int 32-bit, optional)

  • send_as (InputPeer, optional) – Forward the messages as the specified peer

  • quick_reply_shortcut (InputQuickReplyShortcut, optional) – Add the messages to the specified quick reply shortcut », instead.

  • effect (int 64-bit, optional)

  • video_timestamp (int 32-bit, optional) – Start playing the video at the specified timestamp (seconds).

  • allow_paid_stars (int 64-bit, optional) – For paid messages », specifies the amount of Telegram Stars the user has agreed to pay in order to send the message.

  • suggested_post (SuggestedPost, optional) – Used to suggest a post to a channel, see here » for more info on the full flow.

Returns:

Updates

TL Schema

messages.forwardMessages#13704a7c
flags:#
silent:flags.5?true
background:flags.6?true
with_my_score:flags.8?true
drop_author:flags.11?true
drop_media_captions:flags.12?true
noforwards:flags.14?true
allow_paid_floodskip:flags.19?true
from_peer:InputPeer
id:Vector<int>
random_id:Vector<long>
to_peer:InputPeer
top_msg_id:flags.9?int
reply_to:flags.22?InputReplyTo
schedule_date:flags.10?int
schedule_repeat_period:flags.24?int
send_as:flags.13?InputPeer
quick_reply_shortcut:flags.17?InputQuickReplyShortcut
effect:flags.18?long
video_timestamp:flags.20?int
allow_paid_stars:flags.21?long
suggested_post:flags.23?SuggestedPost

= Updates

Parameter Tree

ForwardMessages
├── silent → true (optional)
├── background → true (optional)
├── with_my_score → true (optional)
├── drop_author → true (optional)
├── drop_media_captions → true (optional)
├── noforwards → true (optional)
├── allow_paid_floodskip → true (optional)
├── from_peer → InputPeer
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_id → long
│ ├── InputPeerUser
│ │ ├── user_id → long
│ │ └── access_hash → long
│ ├── InputPeerChannel
│ │ ├── channel_id → long
│ │ └── access_hash → long
│ │ ├── peer → InputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_id → int
│ │ └── user_id → long
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── channel_id → long
├── id → Vector < int >
├── random_id → Vector < long >
├── to_peer → InputPeer
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_id → long
│ ├── InputPeerUser
│ │ ├── user_id → long
│ │ └── access_hash → long
│ ├── InputPeerChannel
│ │ ├── channel_id → long
│ │ └── access_hash → long
│ │ ├── peer → InputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_id → int
│ │ └── user_id → long
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── channel_id → long
├── top_msg_id → int (optional)
├── reply_to → InputReplyTo (optional)
│ ├── InputReplyToMessage
│ │ ├── reply_to_msg_id → int
│ │ ├── top_msg_id → int (optional)
│ │ ├── reply_to_peer_id → InputPeer (optional)
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── quote_text → string (optional)
│ │ ├── quote_entities → Vector < MessageEntity > (optional)
│ │ │ ├── MessageEntityUnknown
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityMention
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityHashtag
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityBotCommand
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityUrl
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityEmail
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityBold
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityItalic
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityCode
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityPre
│ │ │ │ ├── offset → int
│ │ │ │ ├── length → int
│ │ │ │ └── language → string
│ │ │ ├── MessageEntityTextUrl
│ │ │ │ ├── offset → int
│ │ │ │ ├── length → int
│ │ │ │ └── url → string
│ │ │ ├── MessageEntityMentionName
│ │ │ │ ├── offset → int
│ │ │ │ ├── length → int
│ │ │ │ └── user_id → long
│ │ │ ├── InputMessageEntityMentionName
│ │ │ │ ├── offset → int
│ │ │ │ ├── length → int
│ │ │ │ └── user_id → InputUser
│ │ │ │ ├── InputUserEmpty
│ │ │ │ ├── InputUserSelf
│ │ │ │ ├── InputUser
│ │ │ │ └── InputUserFromMessage
│ │ │ ├── MessageEntityPhone
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityCashtag
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityUnderline
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityStrike
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityBankCard
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntitySpoiler
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityCustomEmoji
│ │ │ │ ├── offset → int
│ │ │ │ ├── length → int
│ │ │ │ └── document_id → long
│ │ │ ├── MessageEntityBlockquote
│ │ │ │ ├── collapsed → true (optional)
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityFormattedDate
│ │ │ │ ├── relative → true (optional)
│ │ │ │ ├── short_time → true (optional)
│ │ │ │ ├── long_time → true (optional)
│ │ │ │ ├── short_date → true (optional)
│ │ │ │ ├── long_date → true (optional)
│ │ │ │ ├── day_of_week → true (optional)
│ │ │ │ ├── offset → int
│ │ │ │ ├── length → int
│ │ │ │ └── date → int
│ │ │ ├── MessageEntityDiffInsert
│ │ │ │ ├── offset → int
│ │ │ │ └── length → int
│ │ │ ├── MessageEntityDiffReplace
│ │ │ │ ├── offset → int
│ │ │ │ ├── length → int
│ │ │ │ └── old_text → string
│ │ │ └── MessageEntityDiffDelete
│ │ │ ├── offset → int
│ │ │ └── length → int
│ │ ├── quote_offset → int (optional)
│ │ ├── monoforum_peer_id → InputPeer (optional)
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── todo_item_id → int (optional)
│ │ └── poll_option → bytes (optional)
│ ├── InputReplyToStory
│ │ ├── peer → InputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ └── story_id → int
│ └── InputReplyToMonoForum
│ └── monoforum_peer_id → InputPeer
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ ├── InputPeerUser
│ ├── InputPeerChannel
├── schedule_date → int (optional)
├── schedule_repeat_period → int (optional)
├── send_as → InputPeer (optional)
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_id → long
│ ├── InputPeerUser
│ │ ├── user_id → long
│ │ └── access_hash → long
│ ├── InputPeerChannel
│ │ ├── channel_id → long
│ │ └── access_hash → long
│ │ ├── peer → InputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_id → int
│ │ └── user_id → long
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── channel_id → long
├── quick_reply_shortcut → InputQuickReplyShortcut (optional)
│ │ └── shortcut → string
│ └── shortcut_id → int
├── effect → long (optional)
├── video_timestamp → int (optional)
├── allow_paid_stars → long (optional)
└── suggested_post → SuggestedPost (optional)
└── SuggestedPost
├── accepted → true (optional)
├── rejected → true (optional)
├── price → StarsAmount (optional)
│ ├── StarsAmount
│ │ ├── amount → long
│ │ └── nanos → int
│ └── StarsTonAmount
│ └── amount → long
└── schedule_date → int (optional)

Example

await app.invoke(
    ForwardMessages(
        silent=None,
        background=None,
        with_my_score=None,
        drop_author=None,
        drop_media_captions=None,
        noforwards=None,
        allow_paid_floodskip=None,
        from_peer=await app.resolve_peer(chat_id),
        id=[0],
        random_id=[app.rnd_id()],
        to_peer=await app.resolve_peer(chat_id),
        top_msg_id=0,
        reply_to=InputReplyToMessage(
            reply_to_msg_id=0,
            top_msg_id=None,
            reply_to_peer_id=None,
            quote_text=None,
            quote_entities=None,
            quote_offset=None,
            monoforum_peer_id=None,
            todo_item_id=None,
            poll_option=None
        ),
        schedule_date=0,
        schedule_repeat_period=0,
        send_as=await app.resolve_peer(chat_id),
        quick_reply_shortcut=InputQuickReplyShortcut(shortcut="text"),
        effect=0,
        video_timestamp=0,
        allow_paid_stars=0,
        suggested_post=SuggestedPost(
            accepted=None,
            rejected=None,
            price=None,
            schedule_date=None
        ),
    )
)