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):
|
||||
if not ctx.author.guild_permissions.administrator:
|
||||
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:
|
||||
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]:
|
||||
quotes.pop(author)
|
||||
await ctx.channel.send("Successfully removed quote!")
|
||||
config_save()
|
||||
return
|
||||
|
||||
await ctx.channel.send("No such quote found!")
|
||||
|
||||
Reference in New Issue
Block a user