From 3b13c63ba308b1cb4b214316e48c7cc644829a74 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 21 Jun 2025 02:38:49 +0500 Subject: feat: voice message support --- main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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() -- cgit v1.2.3