From 0c48900ce7a11cbeba1ca4e5591fb372786f2686 Mon Sep 17 00:00:00 2001 From: usedfirewood <35475204+usedfirewood@users.noreply.github.com> Date: Sun, 24 Jan 2021 10:34:04 -0900 Subject: [PATCH] Fix to Antonyms and Synonyms (#198) * Update dictionary.py Test attempt to fix Synonyms * Update dictionary.py Another attempt at fixing Synonyms * Update dictionary.py Antonym fix * Update dictionary.py Antonym fix Co-authored-by: usedfirewood --- dictionary/dictionary.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dictionary/dictionary.py b/dictionary/dictionary.py index 5fb83d5..d337eaf 100644 --- a/dictionary/dictionary.py +++ b/dictionary/dictionary.py @@ -39,7 +39,7 @@ class Dictionary(commands.Cog): result = await self._antonym(ctx, search_term) if not result: await ctx.send("This word is not in the dictionary.") - return + return result_text = "*, *".join(result) msg = f"Antonyms for **{search_term}**: *{result_text}*" @@ -50,7 +50,7 @@ class Dictionary(commands.Cog): data = await self._get_soup_object(f"http://www.thesaurus.com/browse/{word}") if not data: return await ctx.send("Error fetching data.") - section = data.find_all("a", {"class": "css-itvgb eh475bn1"}) + section = data.find_all("a", {"class": "css-1dcngqk eh475bn1"}) antonyms = [item.text.rstrip() for item in section] return antonyms @@ -111,7 +111,7 @@ class Dictionary(commands.Cog): data = await self._get_soup_object(f"http://www.thesaurus.com/browse/{word}") if not data: return await ctx.send("Error fetching data.") - section = data.find_all("a", {"class": "css-1s3v085 eh475bn1"}) + section = data.find_all("a", {"class": "css-1m14xsh eh475bn1"}) synonyms = [item.text.rstrip() for item in section] return synonyms