diff --git a/bible/bible.py b/bible/bible.py index c714120..ecbeb86 100644 --- a/bible/bible.py +++ b/bible/bible.py @@ -69,7 +69,9 @@ class Bible(commands.Cog): await ctx.send(str(e)) return passage = await self._get_passage(bible_id, f"{book_id}.{chapter}.{verse}") - await ctx.send(passage["content"]) + embed = Embed(title=f"{passage['reference']}", description=passage["content"].replace('¶ ', ''), color=await self.bot.get_embed_color(ctx.channel)) + embed.footer = f"{ctx.prefix}bible verse - Powered by API.bible" + await ctx.send(embed=embed) @bible.command(name="passage") async def bible_passage(self, ctx: commands.Context, book: str, passage: str): @@ -85,11 +87,14 @@ class Bible(commands.Cog): await ctx.send(str(e)) return - from_verse, to_verse = passage.replace(":", ".").split("-") - if '.' not in to_verse: - to_verse = f"{from_verse.split('.')[0]}.{to_verse}" - - passage = await self._get_passage(bible_id, f"{book_id}.{from_verse}-{book_id}.{to_verse}") + if len(passage.split('-')) == 2: + from_verse, to_verse = passage.replace(":", ".").split("-") + if '.' not in to_verse: + to_verse = f"{from_verse.split('.')[0]}.{to_verse}" + passage = await self._get_passage(bible_id, f"{book_id}.{from_verse}-{book_id}.{to_verse}") + else: + passage = await self._get_passage(bible_id, f"{book_id}.{passage.replace(':', '.')}") embed = Embed(title=f"{passage['reference']}", description=passage["content"].replace('¶ ', ''), color=await self.bot.get_embed_color(ctx.channel)) + embed.footer = f"{ctx.prefix}bible passage - Powered by API.bible" await ctx.send(embed=embed)