I have a code simple telegram echo bot.
import config
import telebot
bot = telebot.TeleBot(config.token)
@bot.message_handler(content_types=["text"])
def repeat_all_messages(message):
bot.send_message(message.chat.id, message.text)
if __name__ == '__main__':
bot.polling(none_stop=True)
But I want to bot which will send the received message to another chat as Forward. I tried following way
chat = '187458737'
bot.forward_message(chat, message.chat.id, message.text)
But It did not lead to success. How I should modify my bot?
you shoul do this :
bot.forward_message(to_chat_id, from_chat_id, message_id)
message_id- id of message wich you want to repost
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With