Improve visual
This commit is contained in:
+4
-13
@@ -16,23 +16,14 @@ async def send_message_safe(
|
||||
chat_id: Optional[int],
|
||||
text: str,
|
||||
**kwargs
|
||||
) -> None:
|
||||
"""
|
||||
Safely send message to Telegram.
|
||||
|
||||
Args:
|
||||
bot: Bot instance
|
||||
chat_id: Target chat ID
|
||||
text: Message text
|
||||
**kwargs: Additional arguments for send_message
|
||||
"""
|
||||
):
|
||||
if not bot or not chat_id:
|
||||
return
|
||||
|
||||
return None
|
||||
try:
|
||||
await bot.send_message(chat_id=chat_id, text=text, **kwargs)
|
||||
return await bot.send_message(chat_id=chat_id, text=text, **kwargs)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send message: {e}")
|
||||
return None
|
||||
|
||||
|
||||
async def send_visit_result(
|
||||
|
||||
Reference in New Issue
Block a user