I decided to somehow do a Google search through discord.py wrote the code
@bot.event
async def on_message(message):
if message.content.startswith('just google'):
searchContent = ""
text = str(message.content).split(' ')
for i in range(2, len(text)):
searchContent = searchContent + text[i]
for j in search(searchContent, tld="co.in", num=1, stop=1, pause=2):
await message.channel.send(j)
used this to make it all work: pip install beautifulsoup4 pip install google
the command works, but the rest of the bot commands do not work like
@bot.command()
async def Meme(ctx):
here most likely you need to rework the beginning of the code for a similar like
@bot.event
async def google(ctx):
searchContent = ""
text = str(message.content).split(' ')
for i in range(2, len(text)):
searchContent = searchContent + text[i]
for j in search(searchContent, tld="co.in", num=1, stop=1, pause=2):
await message.channel.send(j)
but this code only shows how to do it, it won't work. in fact I don't know how to make something similar to the last code