Fix some quote remove issues

This commit is contained in:
2021-01-29 11:42:15 +01:00
parent 3234218b4e
commit eaa46988fb

3
bot.py
View File

@@ -315,7 +315,7 @@ async def quote_command(ctx: commands.Context, author: Optional[str], *, quote:
async def quote_remove_command(ctx: commands.Context, author: str, quote: str): async def quote_remove_command(ctx: commands.Context, author: str, quote: str):
if not ctx.author.guild_permissions.administrator: if not ctx.author.guild_permissions.administrator:
await ctx.channel.send("Only admins are allowed to remove quotes!") await ctx.channel.send("Only admins are allowed to remove quotes!")
quotes: Optional[dict[str, List[str]]] = config_get("guild_access", guild=ctx.guild.id) quotes: Optional[dict[str, List[str]]] = config_get("guild_quotes", guild=ctx.guild.id)
if quotes is None: if quotes is None:
await ctx.channel.send("No quotes available!") await ctx.channel.send("No quotes available!")
@@ -329,6 +329,7 @@ async def quote_remove_command(ctx: commands.Context, author: str, quote: str):
if not quotes[author]: if not quotes[author]:
quotes.pop(author) quotes.pop(author)
await ctx.channel.send("Successfully removed quote!") await ctx.channel.send("Successfully removed quote!")
config_save()
return return
await ctx.channel.send("No such quote found!") await ctx.channel.send("No such quote found!")