async def remove(self, ctx:commands.Context, trigger:str): """command_remove_help""" trigger = trigger.lower() trigger = await Utils.clean(trigger) if len(trigger) > 20: await MessageUtils.send_to(ctx, 'WHAT', 'custom_command_trigger_too_long') elif trigger in self.commands[ctx.guild.id]: CustomCommand.get(serverid = ctx.guild.id, trigger=trigger).delete_instance() del self.commands[ctx.guild.id][trigger] await ctx.send(f"{Emoji.get_chat_emoji('YES')} {Translator.translate('custom_command_removed', ctx.guild.id, trigger=trigger)}") else: await ctx.send(f"{Emoji.get_chat_emoji('NO')} {Translator.translate('custom_command_not_found', ctx.guild.id, trigger=trigger)}")
async def remove(self, ctx: commands.Context, trigger: str): """Removes a custom command""" trigger = trigger.lower() if trigger in self.commands[ctx.guild.id]: CustomCommand.get(serverid=ctx.guild.id, trigger=trigger).delete_instance() del self.commands[ctx.guild.id][trigger] await ctx.send( f"{Emoji.get_chat_emoji('YES')} {Translator.translate('custom_command_removed', ctx.guild.id, trigger=trigger)}" ) else: await ctx.send( f"{Emoji.get_chat_emoji('NO')} {Translator.translate('custom_command_not_found', ctx.guild.id, trigger=trigger)}" )