DEV Community

Discussion on: Making a Discord Bot using Discord.py

Collapse
 
sakshamlata profile image
Sakshamlata

I need help to convert this code :P:

@client.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)
Enter fullscreen mode Exit fullscreen mode

This is the code but its on asycn branch I need in rewrite branch without removing its function can anyone help me pls:)