From 89bdf5583c7546bf31f467d0ddb772ba3f914180 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 1 Feb 2024 18:14:42 -0500 Subject: [PATCH] feat(bible): added ability to fetch passages --- bible/bible.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bible/bible.py b/bible/bible.py index 070dcb9..09a8a0a 100644 --- a/bible/bible.py +++ b/bible/bible.py @@ -68,3 +68,19 @@ class Bible(commands.Cog): return passage = await self._get_passage(bible_id, f"{book_id}.{chapter}.{verse}") await ctx.send(passage["content"]) + + @bible.command(name="passage") + async def bible_passage(self, ctx: commands.Context, book: str, passage: str): + """Get a Bible passage. + + Example usage: + `[p]bible passage John 3:16-3:17`""" + bible_id = await self.config.bible() + try: + book_id = await self.translate_book_name(bible_id, book) + except ValueError as e: + await ctx.send(str(e)) + return + from_verse, to_verse = passage.replace(":", ".").split("-") + passage = await self._get_passage(bible_id, f"{book_id}.{from_verse}-{book_id}.{to_verse}") + await ctx.send(passage["content"])