Discord.py bot:为特定用户过滤命令

Discord.py bot: Filter commands for specific user

有谁知道我如何才能只允许一个特定用户访问命令?

我会这样做:

@bot.command()
async def commandname(ctx):
if ctx.author.id == 'usersID': 
   # do something 
else: 
  await ctx.send(f"Sorry you can't do that.")