-
I'm developing a simple echo bot, that would forward (post) received message to the channel. It's easy to do when the message contains single media with caption. While when the user sends multiple media in a single message, bot will forward every media as a new message. I've tried to use bot.CopyMessages but it fails as message_ids are null. How can I get those values? Code:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hi, please take a look at // CopyMessageParams - Represents parameters of copyMessage method.
type CopyMessageParams struct {
// ChatID - Unique identifier for the target chat or username of the target channel (in the format
// @channel_username)
ChatID ChatID `json:"chat_id"`
// MessageThreadID - Optional. Unique identifier for the target message thread (topic) of the forum; for
// forum supergroups only
MessageThreadID int `json:"message_thread_id,omitempty"`
// FromChatID - Unique identifier for the chat where the original message was sent (or channel username in
// the format @channel_username)
FromChatID ChatID `json:"from_chat_id"`
// MessageID - Message identifier in the chat specified in from_chat_id
MessageID int `json:"message_id"`
// ...
} It has 3 required parameters: |
Beta Was this translation helpful? Give feedback.
-
Ok, I've tried to collect MediaGroup but when I send "yes" to provide it back to user I get an error:
Here is the code:
|
Beta Was this translation helpful? Give feedback.
-
Ok, Found a solution. I should provide Type: "video" or Type: "photo" in struct. Providing working code. Closing discussion
|
Beta Was this translation helpful? Give feedback.
Ok, Found a solution. I should provide Type: "video" or Type: "photo" in struct. Providing working code. Closing discussion