await error
hi. i am trying to make a discord chat bot.
when i put in “await”
there is this error appearing : Syntax Error : ‘await’ outside function
19wintersp
You can only use await
inside of an async
function.
19wintersp
@xxpertHacker That's unrelated, this is Python
xxpertHacker
@19wintersp How was I supposed to have known?
await
outside of anasync
function. The last two lines should be like this:I also made some necessary changes. And you should put the token in a
.env
file so that even if the repl is public you don't need to remove the token to show it to someone.