diff options
| author | ilotterytea <iltsu@alright.party> | 2025-06-21 02:56:38 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-06-21 02:56:38 +0500 |
| commit | 856bb35ffffc5e3fa2f2962593dfae9ec53745b7 (patch) | |
| tree | 860f82c184a125e47ff4bb66fb12bde782c9a33e | |
| parent | eb4c29102504efba530e699ed500ee265c857f1d (diff) | |
feat: text messages support
| -rw-r--r-- | main.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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() |
