✨
This commit is contained in:
@ -5,8 +5,8 @@ from interactions import Client, Status
|
||||
from pymongo import MongoClient # Used for database management
|
||||
|
||||
from gwendolyn.utils import log
|
||||
from gwendolyn.exceptions import NoToken, MongoCannotConnect
|
||||
from gwendolyn.funcs import Other
|
||||
from gwendolyn.exceptions import NoToken, CannotConnectToService
|
||||
from gwendolyn.funcs import Other, BetterNetflix, Sonarr, Radarr, TMDb
|
||||
|
||||
class Gwendolyn(Client):
|
||||
def __init__(self, testing: bool = True):
|
||||
@ -41,17 +41,25 @@ class Gwendolyn(Client):
|
||||
|
||||
try:
|
||||
database_client.admin.command("ping")
|
||||
self.log("Connected to Mango Client")
|
||||
except:
|
||||
raise MongoCannotConnect()
|
||||
raise CannotConnectToService("Mango Client")
|
||||
|
||||
if self.testing:
|
||||
self.log("Testing mode")
|
||||
self.database = database_client["Gwendolyn-Test"]
|
||||
self.load_extension("interactions.ext.jurigged")
|
||||
else:
|
||||
self.database = database_client["Gwendolyn"]
|
||||
|
||||
def _add_functions(self):
|
||||
self.other = Other(self)
|
||||
self.better_netflix = BetterNetflix(
|
||||
Radarr(getenv("RADARR_IP"),getenv("RADARR_PORT"),getenv("RADARR_API_KEY")),
|
||||
Sonarr(getenv("SONARR_IP"),getenv("SONARR_PORT"),getenv("SONARR_API_KEY")),
|
||||
TMDb(getenv("TMDB_API_ACCESS_TOKEN")),
|
||||
self
|
||||
)
|
||||
|
||||
def _add_extensions(self):
|
||||
"""Load cogs."""
|
||||
|
Reference in New Issue
Block a user