diff --git a/config/app.py b/config/app.py index 30009bc..05b2b2f 100644 --- a/config/app.py +++ b/config/app.py @@ -1,5 +1,6 @@ from config.vault import get_vault + class Settings: def __init__(self): self.environment = "development" diff --git a/main.py b/main.py index e3777a2..5f998a3 100644 --- a/main.py +++ b/main.py @@ -1,13 +1,10 @@ import asyncio import atexit import socket -from datetime import datetime + from providers.modifiers.logger import setup_logger from database.executioners.initiator import db_pool - -import discord -import json -from discord import Intents, Status, Activity, ActivityType +from discord import Intents, Status, Activity, ActivityType, Bot from providers.database.migration_provider import run_migrations from providers.database.seeding_provider import run_seeders @@ -17,7 +14,7 @@ intents = Intents(guilds=True) -bot = discord.Bot(intents=intents, status=Status.online, +bot = Bot(intents=intents, status=Status.online, activity=Activity(type=ActivityType.playing, name="starting up script...")) diff --git a/providers/database/functions.py b/providers/database/functions.py index 4f1465b..3e45077 100644 --- a/providers/database/functions.py +++ b/providers/database/functions.py @@ -31,9 +31,9 @@ async def run_tasks(directory_name, task_name, task_type): if not hasattr(module, task_type): raise AttributeError(f"{task_type} class not found in {task_name}") - TaskClass = getattr(module, task_type) + task_class = getattr(module, task_type) - task_instance = TaskClass() + task_instance = task_class() task_data = { "name": task_instance.get_table() if task_type == "Seeder" else task_instance.get_name(), @@ -99,4 +99,4 @@ async def run_migrations(): """ Runs the migration tasks """ - await run_tasks("migrations", "Migration", "Schema") \ No newline at end of file + await run_tasks("migrations", "Migration", "Schema") diff --git a/providers/database/migration_provider.py b/providers/database/migration_provider.py index 00f9331..2de82d2 100644 --- a/providers/database/migration_provider.py +++ b/providers/database/migration_provider.py @@ -5,4 +5,4 @@ async def run_migrations(): """ Runs the migration tasks """ - await run_tasks("migrations", "Migration", "Schema") \ No newline at end of file + await run_tasks("migrations", "Migration", "Schema") diff --git a/providers/database/seeding_provider.py b/providers/database/seeding_provider.py index 7317810..7608cc3 100644 --- a/providers/database/seeding_provider.py +++ b/providers/database/seeding_provider.py @@ -1,7 +1,8 @@ from providers.database.functions import run_tasks + async def run_seeders(): """ Runs the seeder tasks """ - await run_tasks("seeders", "Seeder", "Seeder") \ No newline at end of file + await run_tasks("seeders", "Seeder", "Seeder")