Home > Blockchain >  Having some problem with discord bot which i am coding in replit
Having some problem with discord bot which i am coding in replit

Time:09-27

I cant start my discord bot in replti.com Is their any fault in my code?

import os

client = discord.Client()

@client.event
async def on_ready():
    print("I'm in")
    print(client.user)

@client.event
async def on_message(message):
    if message.author != client.user:
        await message.channel.send(message.content[::-1])

my_secret = os.environ['TOKEN']
client.run(my_secret)

CodePudding user response:

The method you are using is not good. Rather do this from discord.ext import commands

and then insert commands as such:

@client.commands()
async def hello("")
  • Related