atipugin / telegram-bot-ruby

Ruby wrapper for Telegram's Bot API
https://core.telegram.org/bots/api
Do What The F*ck You Want To Public License
1.35k stars 218 forks source link

How to forward last received message to another chat? #219

Closed Scoopsy closed 1 year ago

Scoopsy commented 4 years ago

I am trying to build a bot that can forward the last received message to another chat.

Example:; Me>bot: Hey bot>2ndchat:Hey

newPerson>bot: what are you? bot>2ndchat: what are you?

This is what ive got so far but it doesnt work, even if i put a value after message_id: is says it was expecting "="

  bot.api.forward_message(to_chat_id: 2*******1, from_chat_id: message.chat.id, message_id: ?)

am i in the right direction or completely off? thanks in advance!

alexander-saratovcev commented 4 years ago

Did you try to provide a message_id?

bot.api.forward_message(to_chat_id: 2*******1, from_chat_id: message.chat.id, message_id: message.id)

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.