A
A
Alexander2020-07-30 00:33:06
Python
Alexander, 2020-07-30 00:33:06

Need help forwarding messages between Telebot channels?

Hello, I need help with code. I am writing a bot that should automatically send messages from other private channels to my channel. I played a lot with the code and decided to try forward_message, but after you fill in the arguments, nothing happens, there is no error. But when you put your id instead of from_chat_id, he forwards everything that you write to him. Maybe someone has a ready-made bot, or a piece of code that does all this, please send it off.
Telegram: @s1mpa1

My code:

import telebot
import Config
bot = telebot.TeleBot(Config.Token)

@bot.message_handler(commands=['start'])
def send_welcome(message):
  bot.reply_to(message, "Привет")

@bot.message_handler(func=lambda message: True)
def echo_all(message):
    bot.forward_message(chat_id=494227133, from_chat_id=494227133, message_id=message.message.id)


bot.polling()

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question