telethon.errors.rpcerrorlist.FloodWaitError: A wait of 2966 seconds is required
from telethon import errors
try:
messages = await client.get_messages(chat)
print(messages[0].text)
except errors.FloodWaitError as e:
print('Have to sleep', e.seconds, 'seconds')
time.sleep(e.seconds)