summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-06-21 02:38:49 +0500
committerilotterytea <iltsu@alright.party>2025-06-21 02:38:49 +0500
commit3b13c63ba308b1cb4b214316e48c7cc644829a74 (patch)
tree276715ab0a6de60302de2f931db7d0057f93f1f1
parent569cb9b1f91799056d0f1c6fdfb64887f7ee6d60 (diff)
feat: voice message support
-rw-r--r--main.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.py b/main.py
index acaeedc..0c9cddb 100644
--- a/main.py
+++ b/main.py
@@ -61,6 +61,8 @@ async def download_file(update: Update, _: CallbackContext) -> None:
file_path = await download_locally_file(update, update.message.video)
elif update.message.video_note is not None:
file_path = await download_locally_file(update, update.message.video_note)
+ elif update.message.voice is not None:
+ file_path = await download_locally_file(update, update.message.voice)
if file_path is not None:
try:
@@ -75,7 +77,11 @@ async def download_file(update: Update, _: CallbackContext) -> None:
def run():
print("Starting the bot...")
app = ApplicationBuilder().token("xd").build()
- app.add_handler(MessageHandler(filters.PHOTO | filters.VIDEO | filters.VIDEO_NOTE, download_file))
+ app.add_handler(MessageHandler(
+ filters.PHOTO | filters.VIDEO | filters.VIDEO_NOTE |
+ filters.VOICE,
+ download_file
+ ))
app.run_polling()