summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-06-21 02:56:38 +0500
committerilotterytea <iltsu@alright.party>2025-06-21 02:56:38 +0500
commit856bb35ffffc5e3fa2f2962593dfae9ec53745b7 (patch)
tree860f82c184a125e47ff4bb66fb12bde782c9a33e
parenteb4c29102504efba530e699ed500ee265c857f1d (diff)
feat: text messages support
-rw-r--r--main.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/main.py b/main.py
index d5f4d0e..96587b4 100644
--- a/main.py
+++ b/main.py
@@ -69,6 +69,11 @@ async def download_file(update: Update, _: CallbackContext) -> None:
file_path = await download_locally_file(update, update.message.animation)
elif update.message.document is not None:
file_path = await download_locally_file(update, update.message.document)
+ elif update.message.text is not None:
+ file_path = f"./temp/{update.message.chat.id}-{update.message.message_id}.txt"
+ with open(file_path, "w") as txtf:
+ txtf.write(update.message.text)
+ txtf.close()
if file_path is not None:
try:
@@ -86,7 +91,7 @@ def run():
app.add_handler(MessageHandler(
filters.PHOTO | filters.VIDEO | filters.VIDEO_NOTE |
filters.VOICE | filters.AUDIO | filters.ANIMATION |
- filters.Document.ALL,
+ filters.Document.ALL | (filters.TEXT & ~filters.COMMAND),
download_file
))
app.run_polling()