cogs/color/management.py
async def on_guild_role_update(self, before, after):
        """Updated a color if the associated role is updated"""
        # Name has changed
        if before.name != after.name:
            db.guilds.update_one(
                {"_id": before.guild.id, "colors.role": before.id},
                {"$set": {"colors.$.name": after.name}}
            )
        # Hexcode has changed
        if before.color != after.color:
            db.guilds.update_one(
                {"_id": before.guild.id, "colors.role": before.id},
                {"$set": {"colors.$.hexcode": str(after.color)}}
            )
Updated a color if the associated role is updated
Updated a color if the associated role is updated
Updated a color if the associated role is updated
async def on_guild_role_update(self, before, after):
        if before.name != after.name:
            db.guilds.update_one(
                {"_id": before.guild.id, "colors.role": before.id},
                {"$set": {"colors.$.name": after.name}}
            )
        if before.color != after.color:
            db.guilds.update_one(
                {"_id": before.guild.id, "colors.role": before.id},
                {"$set": {"colors.$.hexcode": str(after.color)}}
            )
async def on_guild_role_update ( self , before , after ) : if before . name != after . name : db . guilds . update_one ( { "_id" : before . guild . id , "colors.role" : before . id } , { "$set" : { "colors.$.name" : after . name } } ) if before . color != after . color : db . guilds . update_one ( { "_id" : before . guild . id , "colors.role" : before . id } , { "$set" : { "colors.$.hexcode" : str ( after . color ) } } )
Updated a color if the associated role is updated
Updated a color if the associated role is updated
"""Updated a color if the associated role is updated""" # Name has changed # Hexcode has changed
self
before
after