Add ability to remove quotes by their index

This commit is contained in:
2021-03-02 11:36:12 +01:00
parent eaa46988fb
commit 2a27706186

6
bot.py
View File

@@ -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!")