forwardMessages¶
Returns: list[MessageId]
- class litegram.methods.forward_messages.ForwardMessages(*, chat_id: ChatIdUnion, from_chat_id: ChatIdUnion, message_ids: list[int], message_thread_id: int | None = None, direct_messages_topic_id: int | None = None, disable_notification: bool | None = None, protect_content: bool | None = None, **extra_data: Any)[source]¶
Use this method to forward multiple messages of any kind. If some of the specified messages can’t be found or forwarded, they are skipped. Service messages and messages with protected content can’t be forwarded. Album grouping is kept for forwarded messages. On success, an array of
litegram.types.message_id.MessageIdof the sent messages is returned.Source: https://core.telegram.org/bots/api#forwardmessages
- chat_id: ChatIdUnion¶
Unique identifier for the target chat or username of the target channel (in the format
@channelusername)
- from_chat_id: ChatIdUnion¶
Unique identifier for the chat where the original messages were sent (or channel username in the format
@channelusername)
- message_ids: list[int]¶
A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.
- message_thread_id: int | None¶
Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
- direct_messages_topic_id: int | None¶
Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat
Usage¶
As bot method¶
result: list[MessageId] = await bot.forward_messages(...)
Method as object¶
Imports:
from litegram.methods.forward_messages import ForwardMessagesalias:
from litegram.methods import ForwardMessages
With specific bot¶
result: list[MessageId] = await bot(ForwardMessages(...))
As reply into Webhook in handler¶
return ForwardMessages(...)