Merge pull request #1 from bakhrullo/bakhrullo-patch-1

Update broadcast_example.py
This commit is contained in:
bakhrullo 2022-12-27 11:52:13 +03:00 committed by GitHub
commit a05796d2f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: