Add ability to remove quotes by their index
This commit is contained in:
6
bot.py
6
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!")
|
await ctx.channel.send("Successfully removed quote!")
|
||||||
config_save()
|
config_save()
|
||||||
return
|
return
|
||||||
|
# No matching quote found
|
||||||
|
try:
|
||||||
|
quote = int(quote)
|
||||||
|
quotes[author].pop(quote)
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
await ctx.channel.send("No such quote found!")
|
await ctx.channel.send("No such quote found!")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user