S
S
Slanty2019-09-29 16:50:00
Python
Slanty, 2019-09-29 16:50:00

How to make a mailing list in Telegram [Python]?

There is a bot in the telegram, there is also a database in which the user ids of the bot are located. The bot
is written on the PyTelegramBotApi module.
Please tell me how to bypass users who have blocked the bot (because of them, the bot crashes when sending)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
Hiccup Heddok, 2019-09-29
@Slanty

You need to use the try except construct:

for user in user_ids:
    try:
        send_message()#Отправляешь сообщение, как там это делается
    except:
        pass #Тут что делать в противном случае

Read about this design.

C
Cicadadenis, 2020-05-06
@Cicadadenis

https://youtu.be/ouOBf2LvK_A
I can offer this in python

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question