Skip to content

Commit

Permalink
fix: qsearch lists any matches when keyword is given
Browse files Browse the repository at this point in the history
  • Loading branch information
dlg1206 committed Apr 25, 2024
1 parent 4a3ca97 commit 6834532
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/quotebot/bot/QuoteBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,9 @@ async def qsearch(ctx, *, keywords=None) -> None:
f"Found {len(all_quotees)} quotees")
# Search for quotees that match the keywords
else:
similar = [format_quotee(q) for q in self.database.find_similar_quotee(keywords)]
if len(similar) != 0:
await ctx.channel.send(f"Here's what I could find:\n{'\n'.join(similar)}")
self.logger.log(str(ctx.message.author), "!qsearch [keywords]", Status.SUCCESS,
f"keywords={keywords}")
await self.list_similar(ctx, keywords, "Here's what I could find")
self.logger.log(str(ctx.message.author), "!qsearch [keywords]", Status.SUCCESS,
f"keywords={keywords}")

@self.command()
async def qstat(ctx, *, quotee=None) -> None:
Expand Down

0 comments on commit 6834532

Please sign in to comment.