C
C
Chillier2019-10-22 13:46:18
Python
Chillier, 2019-10-22 13:46:18

How to make a bot catch new messages on a private channel?

The bot was added by the admin to a private channel and should catch new messages on a private channel, how to do it? Now he only responds to PM messages.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey S., 2019-10-22
@Winsik

@bot.message_handler(func=lambda message: True, content_types=['text'])
def echo_message(message):
    if message.chat.type == "private":
  # личка

    if (message.chat.type == "group" or message.chat.type == "supergroup"):
  # группа


    if message.chat.type == "channel":
  # канал

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question