Fix some quote remove issues
This commit is contained in:
3
bot.py
3
bot.py
@@ -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!")
|
||||||
|
|||||||
Reference in New Issue
Block a user