Merge pull request #113 from ozcho/master

Added queue command
This commit is contained in:
Alfonso E.M 2023-06-20 13:03:49 +02:00 committed by GitHub
commit 8f9eadb316
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)