cogs/theme/management.py
async def rename_theme(self, ctx, *, query):
        """Rename a theme in the guild."""
        themes = db.get(ctx.guild.id, "themes")

        try:
            before, after = query.split("|")
        except ValueError:
            raise UserInputError(
                "Command should be formatted as: $t.rn <theme> | <name>")

        # Find the correct color to remove. or dont.
        theme = theme_lookup(before.strip(), themes)
        if not theme:
            raise UserInputError("Couldn't find that theme")

        after = after.strip()
        if not after:
            raise UserInputError(
                "Command should be formatted as: $rename <color> | <name>")

        db.guilds.update_one(
            {"_id": ctx.guild.id, "themes": theme},
            {"$set": {"themes.$.name": after}}
        )
        await ctx.invoke(self.bot.get_command("themes"))
Rename a theme in the guild.
Rename a theme in the guild.
Rename a theme in the guild .
async def rename_theme(self, ctx, *, query):
        themes = db.get(ctx.guild.id, "themes")
        try:
            before, after = query.split("|")
        except ValueError:
            raise UserInputError(
                "Command should be formatted as: $t.rn <theme> | <name>")
        theme = theme_lookup(before.strip(), themes)
        if not theme:
            raise UserInputError("Couldn't find that theme")
        after = after.strip()
        if not after:
            raise UserInputError(
                "Command should be formatted as: $rename <color> | <name>")
        db.guilds.update_one(
            {"_id": ctx.guild.id, "themes": theme},
            {"$set": {"themes.$.name": after}}
        )
        await ctx.invoke(self.bot.get_command("themes"))
async def rename_theme ( self , ctx , * , query ) : themes = db . get ( ctx . guild . id , "themes" ) try : before , after = query . split ( "|" ) except ValueError : raise UserInputError ( "Command should be formatted as: $t.rn <theme> | <name>" ) theme = theme_lookup ( before . strip ( ) , themes ) if not theme : raise UserInputError ( "Couldn't find that theme" ) after = after . strip ( ) if not after : raise UserInputError ( "Command should be formatted as: $rename <color> | <name>" ) db . guilds . update_one ( { "_id" : ctx . guild . id , "themes" : theme } , { "$set" : { "themes.$.name" : after } } ) await ctx . invoke ( self . bot . get_command ( "themes" ) )
Rename a theme in the guild.
Rename a theme in the guild .
"""Rename a theme in the guild.""" # Find the correct color to remove. or dont.
self
ctx
query