Some small quote improvements

This commit is contained in:
2021-01-27 16:17:15 +01:00
parent 86a40fcacc
commit f434ab2bdf

6
bot.py
View File

@@ -257,13 +257,13 @@ async def quote_command(ctx: commands.Context, author: Optional[str], *, quote:
author = random.choice([*authors]) author = random.choice([*authors])
author_quotes = quotes[author] author_quotes = quotes[author]
quote = '\n'.join(map(lambda line: '> ' + line, random.choice(author_quotes).splitlines())) quote = '\n'.join(map(lambda line: '> ' + line, random.choice(author_quotes).splitlines()))
await ctx.channel.send(quote + '\n**' + author + '**') await ctx.channel.send(quote + '\n *~' + author + '*')
else: else:
await ctx.channel.send("No quotes present!") await ctx.channel.send("No quotes present!")
else: else:
author = author.strip().title() author = author.strip().title()
if quote: if quote:
quote = quote.strip() quote = quote.strip().capitalize()
if author in quotes: if author in quotes:
author_quotes: List[str] = quotes[author] author_quotes: List[str] = quotes[author]
regex = re.compile(r'[\W]') regex = re.compile(r'[\W]')
@@ -285,7 +285,7 @@ async def quote_command(ctx: commands.Context, author: Optional[str], *, quote:
if author in quotes: if author in quotes:
quote = random.choice(quotes[author]) quote = random.choice(quotes[author])
quote = '\n'.join(map(lambda line: '> ' + line, quote.splitlines())) quote = '\n'.join(map(lambda line: '> ' + line, quote.splitlines()))
await ctx.channel.send(quote + '\n**' + author + '**') await ctx.channel.send(quote + '\n *~ ' + author + '*')
else: else:
await ctx.channel.send("Unknown author!") await ctx.channel.send("Unknown author!")