Traceback (most recent call last):
File "c:/Users/----/Downloads/_1/main.py", line 13, in <module>
@client.event
NameError: name 'client' is not defined
PS C:\Users----\Downloads_1> & C:/Users/----/AppData/Local/Programs/Python/Python38/python.exe c:/Users/----/Downloads/_1/main.py
Traceback (most recent call last):
File "c:/Users/----/Downloads/_1/main.py", line 13, in <module>
@client.event
NameError: name 'client' is not defined
#๐ My code isn't working
26 messages ยท Page 1 of 1 (latest)
@viscid lodge
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
well, maybe you need to define that name somewhere then?
oh, and please update to a supported Python version
yours is quite old
I use 3.8
so it seems, but you should be using something newer
3.13 unless you have a good reason to use something older
alrighty, I'll download it. Can you send me the link to it?
surely you can find python.org
aight
btw how can I do this? I'm quite new to coding.
you can't just throw random code together and expect it to work
there has to be some kind of conscious plan on what it will do
like what do you expect @client.event to do?
@client.event
async def on_ready():
print("The bot is ready")
I didn't define it yet, would be nice if you told me how to define it
maybe start with something simpler than writing a discord bot without any coding experience
so you can get familiar with the basics
then progress to more complex tasks such as this
alright
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.