From cef96a01a6f74bdf7c02a2d26f2252bc365b40d0 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Mon, 15 Aug 2022 10:55:25 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20parsemode=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/track.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/track.py b/plugins/track.py index fd29663..8a09324 100644 --- a/plugins/track.py +++ b/plugins/track.py @@ -4,6 +4,7 @@ from asyncio import sleep from os import remove from random import uniform +from pyrogram.enums import ParseMode from pyrogram.errors import FloodWait, ButtonUrlInvalid from pyrogram.types import Message @@ -19,11 +20,11 @@ async def send_track_msg(file, track_msg) -> Message: return await app.send_document(channel_id, file, caption=track_msg.text, force_document=True, - parse_mode="html", + parse_mode=ParseMode.HTML, reply_markup=track_msg.button) else: return await app.send_message(channel_id, track_msg.text, - parse_mode="html", + parse_mode=ParseMode.HTML, reply_markup=track_msg.button) @@ -49,7 +50,7 @@ async def run_every_30_minute(): msg = await app.send_document(channel_id, file, caption=track_msg.text, force_document=True, - parse_mode="html", ) + parse_mode=ParseMode.HTML, ) except Exception: traceback.print_exc() with contextlib.suppress(FileNotFoundError): @@ -65,7 +66,7 @@ async def run_every_30_minute(): msg = await send_track_msg(None, track_msg) except ButtonUrlInvalid: print("Send button error") - msg = await app.send_message(channel_id, track_msg.text, parse_mode="html", ) + msg = await app.send_message(channel_id, track_msg.text, parse_mode=ParseMode.HTML, ) except Exception: traceback.print_exc() await sleep(uniform(0.5, 2.0))