K
K
KinRovtaz2018-06-05 13:48:07
Python
KinRovtaz, 2018-06-05 13:48:07

The bot asks to subscribe to a specific channel, how to check if there was a subscription?

The bot asks to subscribe to the channel, how to check if there was a subscription?
Hence, there are two options for action, if there is a subscription, if it is not.
And, accordingly, checking for a subscription, so as not to ask again.
I am using pyTeleBotApi.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
KinRovtaz, 2018-06-09
@KinRovtaz

oh, I figured it out
the easiest way is to check the status

statuss = ['creator', 'administrator', 'member']
    for chri in statuss:
        if chri == bot.get_chat_member(chat_id=my_channel_id, user_id=message.from_user.id).status:
            bot.send_message(message.chat.id, 'Начнем!')
            break
        # text_ha(message)
        text_handler(message)
    else:
        bot.send_message(message.chat.id, 'Подпишитесь на канал @КАНАЛ ')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question