Exemple #1
0
 async def add(self, ctx: Context, role: ManagedRole, *args: str) -> None:
     """Add member(s) to a role. Admins and role owners only."""
     author = ctx.message.author
     for arg in args:
         member = ctx.message.guild and find_member(ctx.message.guild, arg)
         if not member:
             await ctx.send("I don't know a {}".format(arg))
         elif role in member.roles:
             await ctx.send("{} already has {}".format(
                 member.display_name, role.name))
         else:
             await member.add_roles(role)
             await ctx.send("{} now has {}".format(member.display_name,
                                                   role.name))
Exemple #2
0
 async def owner_add(self, ctx: Context, deck: Deck, *members: str) -> None:
     """Add owner(s) to a deck. Admins and deck owners only."""
     author = ctx.message.author
     # Add
     for arg in members:
         member = ctx.message.guild and find_member(ctx.message.guild, arg)
         if not member:
             await ctx.send("I don't know a {}".format(arg))
         elif member.id in deck.data.owners:
             await ctx.send("{} already owns {}".format(
                 member.display_name, deck.data.name))
         else:
             deck.data.owners.append(member.id)
             await ctx.send("{} is now an owner of {}".format(
                 member.display_name, deck.data.name))
Exemple #3
0
 async def owner_remove(self, ctx: Context, deck: Deck,
                        *members: str) -> None:
     """Removes owner(s) to a deck. Admins and deck owners only."""
     author = ctx.message.author
     # Remove
     for arg in members:
         member = ctx.message.guild and find_member(ctx.message.guild, arg)
         if not member:
             await ctx.send("I don't know a {}".format(arg))
         elif member.id in deck.data.owners:
             deck.data.owners.remove(member.id)
             await ctx.send("{} no longer owns {}".format(
                 member.display_name, deck.data.name))
         else:
             await ctx.send("{} doesn't own {}".format(
                 member.display_name, deck.data.name))
Exemple #4
0
 async def owner_remove(self, ctx: Context, role: ManagedRole,
                        *members: str) -> None:
     """Removes owner(s) to a role. Admins and role owners only."""
     author = ctx.message.author
     # Make sure the owner list exists
     data = json_data.roles[role.id]
     # Remove
     for arg in members:
         member = ctx.message.guild and find_member(ctx.message.guild, arg)
         if not member:
             await ctx.send("I don't know a {}".format(arg))
         elif member.id in data.owners:
             data.owners.remove(member.id)
             await ctx.send("{} no longer owns {}".format(
                 member.display_name, role.name))
         else:
             await ctx.send("{} doesn't own {}".format(
                 member.display_name, role.name))
Exemple #5
0
 async def owner_add(self, ctx: Context, role: ManagedRole,
                     *members: str) -> None:
     """Add owner(s) to a role. Admins and role owners only."""
     author = ctx.message.author
     # Make sure the owner list exists
     data = json_data.roles[role.id]
     # Add
     for arg in members:
         member = ctx.message.guild and find_member(ctx.message.guild, arg)
         if not member:
             await ctx.send("I don't know a {}".format(arg))
         elif member.id in data.owners:
             await ctx.send("{} already owns {}".format(
                 member.display_name, role.name))
         else:
             data.owners.append(member.id)
             await ctx.send("{} is now an owner of {}".format(
                 member.display_name, role.name))