From 0980c7cbf2b432a6f4e1be371544bae4283d88e5 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 2 Feb 2024 01:37:38 -0500 Subject: [PATCH] fix(bible): fixed api requests not being structured to return fums data --- bible/bible.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bible/bible.py b/bible/bible.py index 89ea264..153c1ed 100644 --- a/bible/bible.py +++ b/bible/bible.py @@ -65,6 +65,7 @@ class Bible(commands.Cog): "include-verse-numbers": str(include_verse_numbers).lower(), "include-verse-spans": "false", "use-org-id": "false", + "fums-version": 3, } async with self.session.get(url, headers=headers, params=params) as response: @@ -104,8 +105,11 @@ class Bible(commands.Cog): """Get the books of the Bible from the API.bible API.""" url = f"https://api.scripture.api.bible/v1/bibles/{bible_id}/books" headers = await self.bot.get_shared_api_tokens("api.bible") + params = { + "fums-version": 3, + } - async with self.session.get(url, headers=headers) as response: + async with self.session.get(url, headers=headers, params=params) as response: data = await response.json() self.logger.debug( "_get_books executed with a response code of: %s\n%s", @@ -142,8 +146,11 @@ class Bible(commands.Cog): """Get the chapters of a book from the API.bible API.""" url = f"https://api.scripture.api.bible/v1/bibles/{bible_id}/books/{book_id}/chapters" headers = await self.bot.get_shared_api_tokens("api.bible") + params = { + "fums-version": 3, + } - async with self.session.get(url, headers=headers) as response: + async with self.session.get(url, headers=headers, params=params) as response: data = await response.json() self.logger.debug( "_get_chapters executed with a response code of: %s\n%s", @@ -180,8 +187,11 @@ class Bible(commands.Cog): """Get the verses of a chapter from the API.bible API.""" url = f"https://api.scripture.api.bible/v1/bibles/{bible_id}/chapters/{book_id}.{chapter}/verses" headers = await self.bot.get_shared_api_tokens("api.bible") + params = { + "fums-version": 3, + } - async with self.session.get(url, headers=headers) as response: + async with self.session.get(url, headers=headers, params=params) as response: data = await response.json() self.logger.debug( "_get_verses executed with a response code of: %s\n%s",