From 4560040749cecbaa109b9cbb016421aa7b1e0ebc Mon Sep 17 00:00:00 2001 From: Yasir Aris M Date: Tue, 10 Sep 2024 09:28:14 +0700 Subject: [PATCH] Update misc_tools.py --- misskaty/plugins/misc_tools.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/misskaty/plugins/misc_tools.py b/misskaty/plugins/misc_tools.py index 2dd151de..4890d575 100644 --- a/misskaty/plugins/misc_tools.py +++ b/misskaty/plugins/misc_tools.py @@ -359,10 +359,12 @@ async def gsearch(self, message): except Exception: exc = traceback.format_exc() return await msg.edit(exc) - await msg.edit( - text=f"Ada {total} Hasil Pencarian dari {query}:\n{res}GoogleSearch by @{BOT_USERNAME}", - disable_web_page_preview=True, - ) + if len(res.encode()) > 4000: + await msg.reply_msg( + text=f"Ada {total} Hasil Pencarian dari {query}:\n{res}GoogleSearch by @{BOT_USERNAME}", + disable_web_page_preview=True, + ) + await msg.delete_msg() @app.on_message(filters.command(["tr", "trans", "translate"], COMMAND_HANDLER))