fix(bible): close asyncio session after unloading the cog
Some checks failed
Actions / Build Documentation (MkDocs) (push) Successful in 35s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 40s

This commit is contained in:
cswimr 2025-01-26 00:39:09 +00:00
parent 7d1a9cc01a
commit 2859f93501
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
2 changed files with 15 additions and 32 deletions

View file

@ -4,9 +4,7 @@ from redbot.core.utils.chat_formatting import error
class BibleAccessError(Exception):
def __init__(
self,
message: str = error(
"The provided API key cannot retrieve sections from the configured Bible. Please report this to the bot owner."
),
message: str = error("The provided API key cannot retrieve sections from the configured Bible. Please report this to the bot owner."),
):
super().__init__(message)
self.message = message
@ -15,9 +13,7 @@ class BibleAccessError(Exception):
class Unauthorized(Exception):
def __init__(
self,
message: str = error(
"The API key for API.Bible is missing or invalid. Please report this to the bot owner.\nIf you are the bot owner, please check the documentation [here](<https://seacogs.coastalcommits.com/bible/#setup>)."
),
message: str = error("The API key for API.Bible is missing or invalid. Please report this to the bot owner.\nIf you are the bot owner, please check the documentation [here](<https://seacogs.coastalcommits.com/bible/#setup>)."),
):
super().__init__(message)
self.message = message
@ -44,9 +40,7 @@ class ServiceUnavailable(Exception):
class InexplicableError(Exception):
def __init__(
self,
message: str = error(
"An inexplicable 'Bad Request' error occurred. This error happens occassionally with the API.Bible service. Please try again. If the error persists, please report this to the bot owner."
),
message: str = error("An inexplicable 'Bad Request' error occurred. This error happens occasionally with the API.Bible service. Please try again. If the error persists, please report this to the bot owner."),
):
super().__init__(message)
self.message = message