cogs/color/assignment.py
async def create_role(guild, color):
        """Create a role and update database."""
        role = await guild.create_role(
            name=color["name"],
            color=utils.discord_color(color)
        )
        db.guilds.update_one(
            {"_id": guild.id, "colors.name": color["name"]},
            {"$set": {"colors.$.role": role.id}}
        )
        return role
Create a role and update database.
Create a role and update database.
Create a role and update database .
async def create_role(guild, color):
        role = await guild.create_role(
            name=color["name"],
            color=utils.discord_color(color)
        )
        db.guilds.update_one(
            {"_id": guild.id, "colors.name": color["name"]},
            {"$set": {"colors.$.role": role.id}}
        )
        return role
async def create_role ( guild , color ) : role = await guild . create_role ( name = color [ "name" ] , color = utils . discord_color ( color ) ) db . guilds . update_one ( { "_id" : guild . id , "colors.name" : color [ "name" ] } , { "$set" : { "colors.$.role" : role . id } } ) return role
Create a role and update database.
Create a role and update database .
"""Create a role and update database."""
guild
color