I
I
I-Cube2020-08-17 09:36:24
Python
I-Cube, 2020-08-17 09:36:24

Telegram-bot how to forward messages of any type?

Hello!
In the code, in general, a layman, I can not figure it out in any way.
It is necessary to forward all messages from users to another channel. It’s just that the bot sends the text without problems, but it doesn’t work with the rest of the content type. What needs to be added?

@bot.message_handler(content_types=['photo', 'video', 'text', 'sticker'])
def repeat_all_messages(message):
  bot.send_message(config.owner, (message...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-08-17
@SoreMix

Forward Message not satisfied?
Take ID of audio/video/etc
Call the corresponding method send_audio/send_video/etc
https://github.com/eternnoir/pyTelegramBotAPI#telebot

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question