Skip to content

Commit

Permalink
apanya yg salah yaa
Browse files Browse the repository at this point in the history
  • Loading branch information
yasirarism authored Sep 10, 2024
1 parent af74b68 commit 8a544f3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions misskaty/plugins/misc_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ async def stackoverflow(_, message):

@app.on_message(filters.command(["google"], COMMAND_HANDLER))
@capture_err
async def gsearch(_, message):
async def gsearch(self, message):
if len(message.command) == 1:
return await message.reply("Give a query to search in Google!")
query = message.text.split(maxsplit=1)[1]
Expand All @@ -336,8 +336,9 @@ async def gsearch(_, message):
for result in soup.select(".tF2Cxc"):
link = result.select_one(".yuRUbf a")["href"]
title = result.select_one(".DKV0Md").text
self.log.info(result)
snippet = result.find(class_="VwiC3b yXK7lf lVm3ye r025kc hJNv6b").get_text() if result.find(class_="VwiC3b yXK7lf lVm3ye r025kc hJNv6b") else "-"

self.log.info(snippet)
# appending data to an array
data.append(
{
Expand Down

0 comments on commit 8a544f3

Please sign in to comment.