recruitment/cr.py
async def waiting_remove(
        self, ctx, member: discord.Member, clan_key, account: int = 1
    ):
        """Delete people from the waiting list for a clan"""
        async with ctx.channel.typing():
            clan_key = clan_key.lower()
            valid_keys = [k["nickname"].lower() for k in self.family_clans.values()]
            if clan_key not in valid_keys:
                return await simple_embed(
                    ctx,
                    "Please use a valid clanname:\n{}".format(
                        humanize_list(list(valid_keys))
                    ),
                    False,
                )
            clan_name = None
            for name, data in self.family_clans.items():
                if data.get("nickname").lower() == clan_key:
                    clan_name = name

            if not await self.remove_from_waiting(clan_name, member):
                return await simple_embed(ctx, "Recruit not found in the waiting list.")
            else:
                await ctx.send(
                    (
                        f"{member.mention} has been removed from the waiting list for **{clan_name}**."
                    ),
                    allowed_mentions=discord.AllowedMentions(users=True),
                )
            waiting_role = discord.utils.get(ctx.guild.roles, name="Waiting")
            if not waiting_role:
                await simple_embed(ctx, "Cannot find a role named waiting.")
            try:
                if waiting_role:
                    await member.remove_roles(
                        waiting_role, reason="removing from waitlist"
                    )
            except discord.Forbidden:
                return await simple_embed(
                    ctx, "No permission to remove roles for this user."
                )
            except discord.HTTPException:
                raise
        await ctx.tick()
Delete people from the waiting list for a clan
Delete people from the waiting list for a clan
Delete people from the waiting list for a clan
async def waiting_remove(
        self, ctx, member: discord.Member, clan_key, account: int = 1
    ):
        async with ctx.channel.typing():
            clan_key = clan_key.lower()
            valid_keys = [k["nickname"].lower() for k in self.family_clans.values()]
            if clan_key not in valid_keys:
                return await simple_embed(
                    ctx,
                    "Please use a valid clanname:\n{}".format(
                        humanize_list(list(valid_keys))
                    ),
                    False,
                )
            clan_name = None
            for name, data in self.family_clans.items():
                if data.get("nickname").lower() == clan_key:
                    clan_name = name
            if not await self.remove_from_waiting(clan_name, member):
                return await simple_embed(ctx, "Recruit not found in the waiting list.")
            else:
                await ctx.send(
                    (
                        f"{member.mention} has been removed from the waiting list for **{clan_name}**."
                    ),
                    allowed_mentions=discord.AllowedMentions(users=True),
                )
            waiting_role = discord.utils.get(ctx.guild.roles, name="Waiting")
            if not waiting_role:
                await simple_embed(ctx, "Cannot find a role named waiting.")
            try:
                if waiting_role:
                    await member.remove_roles(
                        waiting_role, reason="removing from waitlist"
                    )
            except discord.Forbidden:
                return await simple_embed(
                    ctx, "No permission to remove roles for this user."
                )
            except discord.HTTPException:
                raise
        await ctx.tick()
async def waiting_remove ( self , ctx , member : discord . Member , clan_key , account : int = 1 ) : async with ctx . channel . typing ( ) : clan_key = clan_key . lower ( ) valid_keys = [ k [ "nickname" ] . lower ( ) for k in self . family_clans . values ( ) ] if clan_key not in valid_keys : return await simple_embed ( ctx , "Please use a valid clanname:\n{}" . format ( humanize_list ( list ( valid_keys ) ) ) , False , ) clan_name = None for name , data in self . family_clans . items ( ) : if data . get ( "nickname" ) . lower ( ) == clan_key : clan_name = name if not await self . remove_from_waiting ( clan_name , member ) : return await simple_embed ( ctx , "Recruit not found in the waiting list." ) else : await ctx . send ( ( f"{member.mention} has been removed from the waiting list for **{clan_name}**." ) , allowed_mentions = discord . AllowedMentions ( users = True ) , ) waiting_role = discord . utils . get ( ctx . guild . roles , name = "Waiting" ) if not waiting_role : await simple_embed ( ctx , "Cannot find a role named waiting." ) try : if waiting_role : await member . remove_roles ( waiting_role , reason = "removing from waitlist" ) except discord . Forbidden : return await simple_embed ( ctx , "No permission to remove roles for this user." ) except discord . HTTPException : raise await ctx . tick ( )
Delete people from the waiting list for a clan
Delete people from the waiting list for a clan
"""Delete people from the waiting list for a clan"""
self
ctx
member
discord.Member
clan_key
account
int