Fix some issues with the quote command
This commit is contained in:
4
bot.py
4
bot.py
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user