From 2a2770618610781a781f73abe9ad307cd7e9f10e Mon Sep 17 00:00:00 2001 From: Siphalor Date: Tue, 2 Mar 2021 11:36:12 +0100 Subject: [PATCH] Add ability to remove quotes by their index --- bot.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bot.py b/bot.py index a3b9c16..f631d96 100644 --- a/bot.py +++ b/bot.py @@ -331,6 +331,12 @@ async def quote_remove_command(ctx: commands.Context, author: str, quote: str): await ctx.channel.send("Successfully removed quote!") config_save() return + # No matching quote found + try: + quote = int(quote) + quotes[author].pop(quote) + except ValueError: + pass await ctx.channel.send("No such quote found!")