Extend quote command

This commit is contained in:
2021-01-27 16:10:34 +01:00
parent 2265d979a7
commit 5dd3f7d8ee

9
bot.py
View File

@@ -252,7 +252,14 @@ async def quote_command(ctx: commands.Context, author: Optional[str], *, quote:
config_set("guild_quotes", quotes, ctx.guild.id)
if author is None:
pass
authors = quotes.keys()
if authors:
author = random.choice([*authors])
author_quotes = quotes[author]
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!")
else:
author = author.strip().title()
quote = quote.strip()