From fa43cc0d5fda20356abce68838aeb88f51e2af93 Mon Sep 17 00:00:00 2001 From: Chiara Oxender <46496608+coxender@users.noreply.github.com> Date: Mon, 30 May 2022 16:29:03 -0400 Subject: [PATCH] feat: allow case insensitive quote search - compare in lower case when in quote search - fix Issue #14 with solution A, the simplest solution --- noncommands/quotes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/noncommands/quotes.py b/noncommands/quotes.py index 3ef6b15..0c3e411 100644 --- a/noncommands/quotes.py +++ b/noncommands/quotes.py @@ -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)