understanding's picture
Create telegram/replies.py
66cb6e7 verified
raw
history blame
383 Bytes
# PATH: bot/telegram/replies.py
from hydrogram.types import Message
async def safe_reply(m: Message, text: str, **kwargs):
try:
return await m.reply_text(text, **kwargs)
except Exception:
return None
async def safe_edit(msg: Message, text: str, **kwargs):
try:
return await msg.edit_text(text, **kwargs)
except Exception:
return None