我目前正在编写一个discord机器人,并试图创建一个类似于Dank Memer机器人的“pls gayrate”的命令。这是我目前的代码:
@client.command()
async def gayrate(ctx):
zeroto100 = random.randint(0, 100)
embedVar = discord.Embed(title = "gayrate lmao", description = "how gay are ya", color = 0xffffff)
embedVar.add_field(name = f"{message.author}", value = "is", zeroto100, "percent gay :gay_pride_flag:"
await ctx.send (embed = embedVar)
当我运行此代码时,它返回:
await ctx.send (embed = embedVar)
^
SyntaxError: invalid syntax
我有所有其他必要的东西来运行这个机器人,只是这部分没有。有人知道如何解决这个问题吗?谢谢
以下是您缺少的内容:
await ctx.send
之前的行中缺少)
after值李>f-strings
进行字符串格式设置李>ctx.message.author
,而不是message.author
李>()
李>修订后的守则如下:
相关问题 更多 >
编程相关推荐