Saya sedang mengerjakan bot discord.py ketika kemarin, di bus saya, beberapa kode saya terhapus. Semuanya berfungsi dengan baik, tetapi sekarang perintah lelucon saya tidak berfungsi. Saya cukup baru dalam pengkodean karena ini adalah minggu ke-2 saya, tetapi dapatkah seseorang menjelaskan kepada saya mengapa ini mengatakan sintaks yang tidak valid?

@bot.command()
async def joke(ctx):
    responses = [
     "Two hunters are out in the woods when one of them collapses. He's not breathing so his friend calls 911. My friend is dead! What should I do? The operator replies, Calm down sir, first make sure that he's really dead. There's a silence, then a loud bang. Back on the phone, the guy says, Ok, now what?",
     "I threw a boomerang a few years ago; now I live in constant fear.",
     "Someone stole my mood ring. I don't know how I feel about that.",
   "Women call me ugly until they find out how much money I make. Then they call me ugly and poor.",
   "You're not completely useless: you can serve as a bad example.",
   "I broke my finger last week. On the other hand, I'm okay.",
     "Appearantly someone in London gets stabbed every 52 seconds. Poor bastard.",
     "A Roman legionaire walks into a bar, holds up two fingers, and says, Five Beers please!"
 await ctx.send(f'{random.choice(responses)}')
0
ax lol 20 November 2020, 17:42

1 menjawab

Jawaban Terbaik

Anda kehilangan tanda kurung tutup di akhir daftar Anda.

0
Guestlol 20 November 2020, 14:50