From 5dd3f7d8ee363e98bd8222df88f658a6dba88f51 Mon Sep 17 00:00:00 2001 From: Siphalor Date: Wed, 27 Jan 2021 16:10:34 +0100 Subject: [PATCH] Extend quote command --- bot.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index d3352f4..647626e 100644 --- a/bot.py +++ b/bot.py @@ -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()