mirror of
https://github.com/alfem/telegram-download-daemon.git
synced 2024-09-20 06:46:05 +08:00
Adding an alert when users send photos instead of files
This commit is contained in:
parent
126c7de37c
commit
e3623a20a3
|
@ -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:
|
||||
filename=getFilename(event)
|
||||
message=await event.reply("{0} added to queue".format(filename))
|
||||
await queue.put([event, message])
|
||||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue