Question:
How can I fix this code
not posting the repl link because of personal names being inside
code snippet:
@client.event()
async def on_ready():
print(‘we have logged in as {0.user}’)
'.format(client))
error is EOL while scanning string literal
What problem are you having exactly? also, can you format your code with ```
since the indentation matters in Python?
The problem I’m having is EOL while scanning string literal,
The console points to the last one of these: )
would it be helpful if I posted a screen shot?
Post a screenshot of what?
posted a screenshot of the error
Yes, but it is preferred to copy and paste it since it’s easier to do research on the error when people can copy and paste parts of it.
here
code:
@client.event()
async def on_ready():
print(‘we have logged in as {0.user}’)
'.format(client)
There should only be 1 )
there based on the code you have gave us.
ah thanks i’ll try it right now
That didn’t work. Any other ideas?
@client.event()
async def on_ready():
print('we have logged in as {0.user}'.format(client)
Just to check this is how you indented your code?
looks like it lemme send a screenshot
Why do you have a '
before the .format()
? That may be the problem
ok that fixed it but now i’ve got this problem
Is that function meant to be indented? Is is a child of another function or something?
what function? sorry im a newbie so i mix up the terms
The function called on_message
oh, thats supposed to be there
Is that function meant to be indented? Since it is the interpreter? thinks that it is part of something else such as another function or a class. And you should check the indentation of the return
.