fix(bible): song of solomon will now translate properly

This commit is contained in:
Seaswimmer 2024-02-01 19:21:10 -05:00
parent feac213017
commit 4a4ffcd1ee
Signed by untrusted user: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -35,7 +35,12 @@ class Bible(commands.Cog):
async def translate_book_name(self, bible_id: str, book_name: str) -> str:
"""Translate a book name to a book ID."""
book_name = book_name.title()
book_name_list = book_name.split()
for w in book_name_list:
book_name_list.remove(w)
if not w.lower() == "of":
w = w.capitalize()
book_name_list.append(w)
books = await self._get_books(bible_id)
for book in books:
if book_name in (book["abbreviation"], book["name"]):