Answer the question
In order to leave comments, you need to log in
How to create a competent telegram bot mailing list?
I made a mailing list in a cycle, it takes the chatid from the txt file, but as soon as it comes across the id of the person who stopped and banned the bot, the mailing stops, an error 403 falls out. How to write a mailing list correctly? Thanks in advance!
elif message.text == "send":
request = 0
handle = open("bot_usr.txt", "r")
for line in handle:
bot.send_message(line,"текст рассылки",parse_mode='markdown')
request = request + 1
time.sleep(0.5)
if request % 30 == 0:
time.sleep(1.5)
request = 0
handle.close()
ERROR - TeleBot: "ApiException occurred, args=('A request to the Telegram API was unsuccessful. The server returned HTTP 403 Forbidden. Response body:\n[b\'{"ok":false,"error_code":403,"description":"Forbidden: bot was blocked by the user"}\']',)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question