mirror of
https://github.com/alfem/telegram-download-daemon.git
synced 2024-09-20 14:56:06 +08:00
commit
8f9eadb316
|
@ -212,8 +212,20 @@ with TelegramClient(getSession(), api_id, api_hash,
|
|||
elif command == "clean":
|
||||
output = "Cleaning "+tempFolder+"\n"
|
||||
output+=subprocess.run(["rm "+tempFolder+"/*."+TELEGRAM_DAEMON_TEMP_SUFFIX], shell=True, stdout=subprocess.PIPE,stderr=subprocess.STDOUT).stdout
|
||||
elif command == "queue":
|
||||
try:
|
||||
files_in_queue = []
|
||||
for q in queue.__dict__['_queue']:
|
||||
files_in_queue.append(getFilename(q[0]))
|
||||
output = "".join([ "{0}\n".format(filename) for (filename) in files_in_queue])
|
||||
if output:
|
||||
output = "Files in queue:\n\n" + output
|
||||
else:
|
||||
output = "Available commands: list, status, clean"
|
||||
output = "Queue is empty"
|
||||
except:
|
||||
output = "Some error occured while checking the queue. Retry."
|
||||
else:
|
||||
output = "Available commands: list, status, clean, queue"
|
||||
|
||||
await log_reply(event, output)
|
||||
|
||||
|
|
Loading…
Reference in a new issue