cogs/theme/management.py
async def overwrite_theme(self, ctx, *, themename):
        """Overwrite one of the Guild's themes with another."""

        colors, themes = db.get_many(ctx.guild.id, "colors", "themes")

        old_theme = theme_lookup(themename, themes)
        if not old_theme:
            raise UserInputError("Could not find that theme")

        # Remove unnecessary role attribute from database
        for color in colors:
            del color["role"]

        # create and add color
        new_theme = {
            "name": old_theme["name"],
            "colors": colors,
        }

        # update database
        db.guilds.update_one(
            {"_id": ctx.guild.id, "themes": old_theme},
            {"$set": {"themes.$": new_theme}}
        )

        if ctx.guild.id not in cfg.suppress_output:
            await ctx.invoke(self.bot.get_command("themes"))
Overwrite one of the Guild's themes with another.
Overwrite one of the Guild's themes with another.
Overwrite one of the Guild ' s themes with another .
async def overwrite_theme(self, ctx, *, themename):
        colors, themes = db.get_many(ctx.guild.id, "colors", "themes")
        old_theme = theme_lookup(themename, themes)
        if not old_theme:
            raise UserInputError("Could not find that theme")
        for color in colors:
            del color["role"]
        new_theme = {
            "name": old_theme["name"],
            "colors": colors,
        }
        db.guilds.update_one(
            {"_id": ctx.guild.id, "themes": old_theme},
            {"$set": {"themes.$": new_theme}}
        )
        if ctx.guild.id not in cfg.suppress_output:
            await ctx.invoke(self.bot.get_command("themes"))
async def overwrite_theme ( self , ctx , * , themename ) : colors , themes = db . get_many ( ctx . guild . id , "colors" , "themes" ) old_theme = theme_lookup ( themename , themes ) if not old_theme : raise UserInputError ( "Could not find that theme" ) for color in colors : del color [ "role" ] new_theme = { "name" : old_theme [ "name" ] , "colors" : colors , } db . guilds . update_one ( { "_id" : ctx . guild . id , "themes" : old_theme } , { "$set" : { "themes.$" : new_theme } } ) if ctx . guild . id not in cfg . suppress_output : await ctx . invoke ( self . bot . get_command ( "themes" ) )
Overwrite one of the Guild's themes with another.
Overwrite one of the Guild ' s themes with another .
"""Overwrite one of the Guild's themes with another.""" # Remove unnecessary role attribute from database # create and add color # update database
self
ctx
themename