def add(self, ctx, *, role: CustomRoleConverter):
"""
Adds a role to the list that can be assigned
"""
if not isinstance(role, discord.Role):
await ctx.send("Could not find role! Creating blank role now :crayon: ")
role = await ctx.guild.create_role(name=role,
colour=Colour.orange(),
mentionable=True,
reason="Role automagically created by GAF Bot for the role list")
if role.position >= ctx.author.top_role.position:
await ctx.send("Unable to add role due to Hierarchy")
else:
guild_config = await self.bot.get_guild_config(ctx.guild.id)
guild_config["roles"][role.id] = role.name
await self.bot.set_guild_config(ctx.guild.id, guild_config)
await ctx.send("Added {} to the role list".format(role.name))
评论列表
文章目录