cogs/color/assignment.py
async def color_user(self, ctx, member: discord.Member, *, cstring=""):
        """Color a specified user a specified color."""

        colors = db.get(ctx.guild.id, "colors")
        ucolor = utils.find_user_color(member, colors)

        if not colors:
            raise CommandError("There are no active colors")

        # to eliminate random coloring the same color
        if len(colors) > 1 and not cstring:
            exclusive_colors = [color for color in colors if color != ucolor]
            color = utils.color_lookup(cstring, exclusive_colors)
        else:
            color = utils.color_lookup(cstring, colors)

        if not color:
            raise CommandError("Color Not Found")

        if color == ucolor:
            raise CommandError(f"{member.name} already has that color")

        # attempt to uncolor and then color user
        if ucolor:
            await self.uncolor(member, ucolor)
        await self.color(member, color)

        embed = discord.Embed(
            title=f"{member.name} is {color['name']} {check_emoji()}",
            color=utils.discord_color(color)
        )
        await ctx.send(embed=embed)
Color a specified user a specified color.
Color a specified user a specified color.
Color a specified user a specified color .
async def color_user(self, ctx, member: discord.Member, *, cstring=""):
        colors = db.get(ctx.guild.id, "colors")
        ucolor = utils.find_user_color(member, colors)
        if not colors:
            raise CommandError("There are no active colors")
        if len(colors) > 1 and not cstring:
            exclusive_colors = [color for color in colors if color != ucolor]
            color = utils.color_lookup(cstring, exclusive_colors)
        else:
            color = utils.color_lookup(cstring, colors)
        if not color:
            raise CommandError("Color Not Found")
        if color == ucolor:
            raise CommandError(f"{member.name} already has that color")
        if ucolor:
            await self.uncolor(member, ucolor)
        await self.color(member, color)
        embed = discord.Embed(
            title=f"{member.name} is {color['name']} {check_emoji()}",
            color=utils.discord_color(color)
        )
        await ctx.send(embed=embed)
async def color_user ( self , ctx , member : discord . Member , * , cstring = "" ) : colors = db . get ( ctx . guild . id , "colors" ) ucolor = utils . find_user_color ( member , colors ) if not colors : raise CommandError ( "There are no active colors" ) if len ( colors ) > 1 and not cstring : exclusive_colors = [ color for color in colors if color != ucolor ] color = utils . color_lookup ( cstring , exclusive_colors ) else : color = utils . color_lookup ( cstring , colors ) if not color : raise CommandError ( "Color Not Found" ) if color == ucolor : raise CommandError ( f"{member.name} already has that color" ) if ucolor : await self . uncolor ( member , ucolor ) await self . color ( member , color ) embed = discord . Embed ( title = f"{member.name} is {color['name']} {check_emoji()}" , color = utils . discord_color ( color ) ) await ctx . send ( embed = embed )
Color a specified user a specified color.
Color a specified user a specified color .
"""Color a specified user a specified color.""" # to eliminate random coloring the same color # attempt to uncolor and then color user
self
ctx
member
discord.Member
cstring