📅  最后修改于: 2022-03-11 14:45:51.344000             🧑  作者: Mango
from discord.ext.commands import Bot, has_permissions, CheckFailure
client = Bot()
@client.command(pass_context=True)
@has_permissions(administrator=True)
async def whoami(ctx):
msg = "You're an admin {}".format(ctx.message.author.mention)
await client.send_message(ctx.message.channel, msg)
@whoami.error
async def whoami_error(error, ctx):
if isinstance(error, CheckFailure):
msg = "You're an average joe {}".format(ctx.message.author.mention)
await client.send_message(ctx.message.channel, msg)