Issue: I copied this right from the Replit Page, I followed the instructions and still it wont work. I did put in the DISCORD_BOT_SECRET
as a variable along with my bot token.
What exactly is the issue here?
Error: Traceback (most recent call last):
File “main.py”, line 6, in
@client.event
NameError: name ‘client’ is not defined
Code:
import os
import discord
discord.Client(intents=discord.Intents.all())
@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['DISCORD_BOT_SECRET']
client.run(my_secret)