Exceptions¶
Example:
import asyncio
from aiotgm.types import Message
from aiotgm import Client, TelegramError
bot = Client('<your_api_token>')
@bot.manage_message()
async def foo(msg: Message):
try:
await bot.send_message(msg.chat.id, "Hello my friend.")
except (TelegramError, TimeoutError) as e:
print(e)