1
I cant find the error
TheSpeakingLava (0)

I cant find the error in my code... It just says invalid syntax, but i cant find whats wrong.... https://im-boi2.thespeakinglava.repl.run

You are viewing a single comment. View All
1
ArchieMaclean (519)

f strings only support variables - you are trying to use a function (random.choice(responses)) inside (on line 45). This doesn't work. An example fix is:

async def _8BALL(ctx, *, question):
  responses = [
    # ...
  ]
  response = random.choice(responses)
  await ctx.send(f'Question: {question}\nAnswer: {response}')

Also, make sure that the await is on the same indentation level as the rest of the function (like above).

Please mark this as the answer if it solved your problem :)

1
1
ArchieMaclean (519)

@TheSpeakingLava On line 45, you had

  await ctx.send(f'Question: {question}\nAnswer: {random.choice(responses)}')

but having random.choice in there doesn't work. So instead you can do

response = random.choice(responses)
await ctx.send(f'Question: {question}\nAnswer: {response}')
1
TheSpeakingLava (0)

@ArchieMaclean Do u have any idea of how I can make it run 24/7 without interacting with it?