Answer the question
In order to leave comments, you need to log in
How to make a newsletter in aiogram?
Unable to send newsletter to every registered user. Sent only to me as an admin.
@dp.message_handler(user_id=admin_id, commands=['tellall'])
async def mailing(message: types.Message):
users = db.select_all_users()
for user in users:
await bot.send_message(chat_id=message.from_user.id,
text="Тестовая рассылка")
await sleep(0.3)
Answer the question
In order to leave comments, you need to log in
Something seems to me that in a line
await bot.send_message(chat_id=message.from_user.id,
should be instead of message.from_user.id - user id from the database. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question