From 661d10415aa0161d98388c76514f61f971fdb3b0 Mon Sep 17 00:00:00 2001 From: neko Date: Tue, 21 Jan 2025 20:02:53 +0500 Subject: [PATCH] Make bot respond to the /start command --- TODO.md | 9 --------- main.py | 6 ++++++ 2 files changed, 6 insertions(+), 9 deletions(-) delete mode 100644 TODO.md diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 6f620d8..0000000 --- a/TODO.md +++ /dev/null @@ -1,9 +0,0 @@ -# TODO -## Planned - -* Add /replace command -* Make every filename random to prevent issues with the same filename - -## In progress -* Add /start command -* Make sure that unoserver restarts https://stackoverflow.com/questions/72146908/how-to-restart-subprocess-if-it-crashes \ No newline at end of file diff --git a/main.py b/main.py index f042384..6cfafec 100644 --- a/main.py +++ b/main.py @@ -97,5 +97,11 @@ async def documentFetcher(client, message): else: return # Hopefully message will get ignored and no futher resources will be used +@app.on_message(filters.command("start")) +async def startResponder(client, message): + startMessage = "This bot converts any document libreoffice supports into a pdf\nYou can add it into your group and it should detect the appropriate files automatically\nList of supported file formats:\n.doc .docx .doc\n.xls .xlsx\n.odt .ods\n.rtf .txt\n.html .csv .tsv\n.epub\n.odp .odp\n.odg\n.vsd .svg\n.ppt .pptx\n.abw .wps\n.tex" + await message.reply(startMessage, reply_to_message_id=message.id) + + unoStart() app.run() \ No newline at end of file