fix(bible): hopefully f ixed translate_book_name
All checks were successful
Actions / Lint Code (Pylint) (push) Successful in 16s
Actions / Build Documentation (MkDocs) (push) Successful in 12s

This commit is contained in:
Seaswimmer 2024-02-01 20:11:22 -05:00
parent 88aad510b9
commit fb2e607af1
Signed by: cswimr
GPG key ID: B8953EC01E5C4063

View file

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