mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Update broadcast_example.py
Added an exception in which the bot is the first to start a conversation
This commit is contained in:
parent
ae534298e5
commit
15e969cf47
1 changed files with 2 additions and 0 deletions
|
|
@ -35,6 +35,8 @@ async def send_message(user_id: int, text: str, disable_notification: bool = Fal
|
|||
await bot.send_message(user_id, text, disable_notification=disable_notification)
|
||||
except exceptions.BotBlocked:
|
||||
log.error(f"Target [ID:{user_id}]: blocked by user")
|
||||
except exceptions.CantInitiateConversation:
|
||||
log.error(f"Target [ID:{user_id}]: bot can't initiate conversation with a user")
|
||||
except exceptions.ChatNotFound:
|
||||
log.error(f"Target [ID:{user_id}]: invalid user ID")
|
||||
except exceptions.RetryAfter as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue