recruitment/cr.py
async def clans_cwr(self, ctx, clankey, league, percent: int):
        """ Set cwr as requirement for clan """
        clan_name = None
        for name, data in self.family_clans.items():
            if data["nickname"].lower() == clankey.lower():
                clan_name = name
        if not clan_name:
            return await ctx.send(f"No clan named {clankey}.")
        try:
            current = self.family_clans[clan_name]["requirements"]["cwr"]
        except KeyError:
            return await ctx.send("There is something wrong with clan database.")
        if league.lower() in current.keys():
            if percent < 0:
                return await ctx.send(
                    "Invalid value for value. Cwr cannot be less than 0."
                )
            current[league.lower()] = int(percent)
        else:
            return await ctx.send(
                f"{league} is not a valid league. Valid leagues are: {humanize_list(list(current.keys()))}"
            )
        async with self.claninfo_lock:
            with open(self.claninfo_path, "w") as file:
                json.dump(self.family_clans, file)
        await ctx.tick()
 Set cwr as requirement for clan 
Set cwr as requirement for clan
Set cwr as requirement for clan
async def clans_cwr(self, ctx, clankey, league, percent: int):
        clan_name = None
        for name, data in self.family_clans.items():
            if data["nickname"].lower() == clankey.lower():
                clan_name = name
        if not clan_name:
            return await ctx.send(f"No clan named {clankey}.")
        try:
            current = self.family_clans[clan_name]["requirements"]["cwr"]
        except KeyError:
            return await ctx.send("There is something wrong with clan database.")
        if league.lower() in current.keys():
            if percent < 0:
                return await ctx.send(
                    "Invalid value for value. Cwr cannot be less than 0."
                )
            current[league.lower()] = int(percent)
        else:
            return await ctx.send(
                f"{league} is not a valid league. Valid leagues are: {humanize_list(list(current.keys()))}"
            )
        async with self.claninfo_lock:
            with open(self.claninfo_path, "w") as file:
                json.dump(self.family_clans, file)
        await ctx.tick()
async def clans_cwr ( self , ctx , clankey , league , percent : int ) : clan_name = None for name , data in self . family_clans . items ( ) : if data [ "nickname" ] . lower ( ) == clankey . lower ( ) : clan_name = name if not clan_name : return await ctx . send ( f"No clan named {clankey}." ) try : current = self . family_clans [ clan_name ] [ "requirements" ] [ "cwr" ] except KeyError : return await ctx . send ( "There is something wrong with clan database." ) if league . lower ( ) in current . keys ( ) : if percent < 0 : return await ctx . send ( "Invalid value for value. Cwr cannot be less than 0." ) current [ league . lower ( ) ] = int ( percent ) else : return await ctx . send ( f"{league} is not a valid league. Valid leagues are: {humanize_list(list(current.keys()))}" ) async with self . claninfo_lock : with open ( self . claninfo_path , "w" ) as file : json . dump ( self . family_clans , file ) await ctx . tick ( )
Set cwr as requirement for clan
Set cwr as requirement for clan
""" Set cwr as requirement for clan """
self
ctx
clankey
league
percent
int