def perminfo(self, ctx, chn: discord.TextChannel=None, usr: discord.User=None):
"""Show permissions for a user."""
if usr is None:
usr = ctx.message.author
if chn is None:
chn = ctx.message.channel
perms = chn.permissions_for(usr)
info = utils.InfoBuilder()
for perm, value in perms:
info.add_field(perm.replace("_", " ").title(), value)
info.add_field("Value", "{:b}".format(perms.value))
await ctx.send(info.code_block())
评论列表
文章目录