Skip to content

Commit

Permalink
feat: allow case insensitive quote search
Browse files Browse the repository at this point in the history
- compare in lower case when in quote search
- fix Issue #14  with solution A, the simplest solution
  • Loading branch information
coxender committed May 30, 2022
1 parent ae6665d commit fa43cc0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions noncommands/quotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ async def quote(self,keywords):
json_data = json.load(f)
quotes = list(json_data['teacherQuotes'])
matches = []
keywords = keywords.lower()

if keywords:
random_quote="Sorry! You made a bad search"
for line in quotes:
if keywords in line:
if keywords in line.lower():
matches.append(line)
if matches:
random_quote = random.choice(matches)
Expand Down

0 comments on commit fa43cc0

Please sign in to comment.