1from discord.ext.commands import Bot, has_permissions, CheckFailure
2
3client = Bot()
4
5@client.command(pass_context=True)
6@has_permissions(administrator=True)
7async def whoami(ctx):
8 msg = "You're an admin {}".format(ctx.message.author.mention)
9 await client.send_message(ctx.message.channel, msg)
10
11@whoami.error
12async def whoami_error(error, ctx):
13 if isinstance(error, CheckFailure):
14 msg = "You're an average joe {}".format(ctx.message.author.mention)
15 await client.send_message(ctx.message.channel, msg)