如何制作高级不和谐.py命令



我想让我添加到列表中的一些人能够使用某些命令,这就是我到目前为止得到的,请帮助我

@client.command()
async def premium(ctx):
premium = set()
premium.add(user_id)
if user_id in premium:
embed=discord.Embed(title="Just a Test Command", description="Trying to make a premium command", color=0xff0000)
embed.set_thumbnail(url="https://images4.alphacoders.com/980/thumb-350-980708.png")
embed.set_footer(text="Made by Cortax#1667")
await ctx.channel.send(embed=embed)

else:
await ctx.channel.send("You are not a premium user")```

它不起作用,因为你忘记了user_id让我们使用:

user_id = ctx.user.id

或交换到:

premium.add(ctx.user.id)

最新更新