Answer the question
In order to leave comments, you need to log in
Why can't the bot find a chat to send?
@dp.message_handler(commands=['sendall'])
async def sendall(message: types.Message):
if message.chat.type == 'private':
text = message.text[9:]
users = db.get_users()
for row in users:
try:
await bot.send_message(row[0], text )
if int(row[1]) !=1:
db.set_active(row[0], 1)
except Exception as e:
print(e)
db.set_active(row[0], 0)
await bot.send_message(message.from_user.id,"Успешная рассылка")
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