Answer the question
In order to leave comments, you need to log in
Why is sending messages to bot users not working?
def answer(bot, update):
global mail, city, cit, rayon,lol, tovari, lol1, tovar
message = update.message
if (message.chat.id in constants.admins) and message.text == 'Рассылка':
mail = True
bot.send_message(message.chat.id, 'Напишите сообщение!')
elif mail == True:
mail = False
text = base_work.all_id()
bot.send_message(message.chat.id, 'В течении 3 секунд, отправиться всем пользователям!')
for i in text:
try:
bot.forward_message(i, message.chat.id, disable_notification=True, message_id=message.message_id)
except:
pass
bot.send_message(message.chat.id, 'Все')
Answer the question
In order to leave comments, you need to log in
I figured out the problem, it turned out that there were people in the database table who did not contact the bot (they were added before I installed the bot), deleted them from the database and everything worked.
Problem number two
, messages are only sent to the first ID in the table and don't go any further. How to be?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question