From 08b3553c2cf169b60dfdbbfe252a4d97d2a03a3e Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 2 Feb 2024 01:51:47 -0500 Subject: [PATCH] fix(bible): do not use fums on routes that don't support it (part 3) --- bible/bible.py | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/bible/bible.py b/bible/bible.py index b3035c7..2ff74de 100644 --- a/bible/bible.py +++ b/bible/bible.py @@ -141,17 +141,12 @@ class Bible(commands.Cog): raise bible.errors.ServiceUnavailable() return data["data"] - async def _get_verses( - self, ctx: commands.Context, bible_id: str, book_id: str, chapter: int - ) -> dict: + async def _get_verses(self, bible_id: str, book_id: str, chapter: int) -> dict: """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, params=params) as response: + async with self.session.get(url, headers=headers) as response: data = await response.json() self.logger.debug( "_get_verses executed with a response code of: %s\n%s", @@ -164,23 +159,7 @@ class Bible(commands.Cog): raise bible.errors.BibleAccessError() if response.status == 503: raise bible.errors.ServiceUnavailable() - - fums_url = "https://fums.api.bible/f3" - fums_params = { - "t": data["meta"]["fumsToken"], - "dId": "discord-" + str(self.bot.user.id), - "sId": "discord-" + str(ctx.message.created_at.timestamp()), - "uId": ctx.author.id, - } - - async with self.session.get(fums_url, params=fums_params) as response: - fums_data = await response.json() - self.logger.debug( - "_get_verses FUMS executed with a response code of: %s\n%s", - response.status, - json.dumps(fums_data), - ) - return data["data"] + return data["data"] @commands.group(autohelp=True) async def bible(self, ctx: commands.Context): @@ -249,9 +228,7 @@ class Bible(commands.Cog): chapters = await self._get_chapters(bible_id, book["id"]) chapter = random.choice(chapters) - verses = await self._get_verses( - ctx, bible_id, book["id"], chapter["number"] - ) + verses = await self._get_verses(bible_id, book["id"], chapter["number"]) verse = random.choice(verses)["id"] passage = await self._get_passage(ctx, bible_id, verse, False)