Adding an alert when users send photos instead of files

This commit is contained in:
Alfonso De Cala Bravo 2021-06-10 15:01:24 +02:00
parent 126c7de37c
commit e3623a20a3

View file

@ -25,7 +25,7 @@ import argparse
import asyncio
TDD_VERSION="1.5"
TDD_VERSION="1.6"
TELEGRAM_DAEMON_API_ID = getenv("TELEGRAM_DAEMON_API_ID")
TELEGRAM_DAEMON_API_HASH = getenv("TELEGRAM_DAEMON_API_HASH")
@ -189,9 +189,13 @@ with TelegramClient(getSession(), api_id, api_hash,
await log_reply(event, output)
if event.media:
if hasattr(event.media, 'document'):
filename=getFilename(event)
message=await event.reply("{0} added to queue".format(filename))
await queue.put([event, message])
else:
message=await event.reply("That is not downloadable. Try to send it as a file.")
except Exception as e:
print('Events handler error: ', e)