Update misc_tools.py

This commit is contained in:
Yasir Aris M 2024-09-10 09:40:10 +07:00 committed by GitHub
parent 2c9cec0fcc
commit a5fa7fc5ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -323,8 +323,8 @@ async def gsearch(self, message):
if len(message.command) == 1:
return await message.reply("Give a query to search in Google!")
def shorten_text(text):
if len(text) > 30:
return text[:30] + "..."
if len(text) > 150:
return text[:150] + "..."
return text
query = message.text.split(maxsplit=1)[1]
msg = await message.reply_text(f"**Googling** for `{query}` ...")
@ -362,7 +362,7 @@ async def gsearch(self, message):
except Exception:
exc = traceback.format_exc()
return await msg.edit(exc)
await msg.reply_msg(
await msg.edit_msg(
text=f"<b>Ada {total} Hasil Pencarian dari {query}:</b>\n{res}<b>GoogleSearch by @{BOT_USERNAME}</b>",
disable_web_page_preview=True,
)