feat(bible): added ability to fetch passages
This commit is contained in:
parent
a432050056
commit
89bdf5583c
1 changed files with 16 additions and 0 deletions
|
@ -68,3 +68,19 @@ class Bible(commands.Cog):
|
||||||
return
|
return
|
||||||
passage = await self._get_passage(bible_id, f"{book_id}.{chapter}.{verse}")
|
passage = await self._get_passage(bible_id, f"{book_id}.{chapter}.{verse}")
|
||||||
await ctx.send(passage["content"])
|
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"])
|
||||||
|
|
Loading…
Reference in a new issue