Fix some issues with the quote command

This commit is contained in:
2021-01-27 16:14:03 +01:00
parent 5dd3f7d8ee
commit 86a4dbcf56

4
bot.py
View File

@@ -249,7 +249,7 @@ async def quote_command(ctx: commands.Context, author: Optional[str], *, quote:
quotes: Optional[dict[str,List[str]]] = config_get("guild_quotes", guild=ctx.guild.id)
if quotes is None:
quotes = {}
config_set("guild_quotes", quotes, ctx.guild.id)
config_set_raw("guild_quotes", quotes, ctx.guild.id)
if author is None:
authors = quotes.keys()
@@ -259,7 +259,7 @@ async def quote_command(ctx: commands.Context, author: Optional[str], *, quote:
quote = '\n'.join(map(lambda line: '> ' + line, random.choice(author_quotes).splitlines()))
await ctx.channel.send(quote + '\n**' + author + '**')
else:
await ctx.channel.send("Unkown author!")
await ctx.channel.send("No quotes present!")
else:
author = author.strip().title()
quote = quote.strip()