2024-08-11 18:54:05 -04:00
|
|
|
from config import config
|
|
|
|
import discord
|
|
|
|
from logger import logger
|
|
|
|
|
2024-08-12 21:23:02 -04:00
|
|
|
logger.info("Starting Elysia...")
|
2024-08-11 18:54:05 -04:00
|
|
|
|
|
|
|
TOKEN = config["TOKEN"]
|
|
|
|
|
|
|
|
intents = discord.Intents.default()
|
|
|
|
|
|
|
|
|
2024-08-13 23:11:42 -04:00
|
|
|
class Elysia(discord.Client):
|
2024-08-11 18:54:05 -04:00
|
|
|
def __init__(self):
|
|
|
|
super().__init__(intents=intents)
|
|
|
|
self.tree = discord.app_commands.CommandTree(self)
|
|
|
|
self.load_modules()
|
|
|
|
|
|
|
|
async def setup_hook(self):
|
|
|
|
logger.info("Setting up...")
|
|
|
|
await self.tree.sync()
|
|
|
|
logger.info("Commands Synced")
|
|
|
|
|
|
|
|
def load_modules(self):
|
|
|
|
try:
|
|
|
|
from config import config
|
|
|
|
except ImportError:
|
|
|
|
logger.error("config.py not found")
|
|
|
|
try:
|
|
|
|
if config["modules"]["birthday"]["enabled"]:
|
2024-08-12 18:38:48 -04:00
|
|
|
from user.birthday import Birthday
|
2024-08-11 18:54:05 -04:00
|
|
|
birthday = Birthday(self)
|
|
|
|
birthday.setup(self.tree)
|
|
|
|
logger.info("Birthday module loaded")
|
|
|
|
except KeyError:
|
|
|
|
logger.error("Birthday module not enabled")
|
|
|
|
|
|
|
|
|
2024-08-13 23:11:42 -04:00
|
|
|
client = Elysia()
|
2024-08-11 18:54:05 -04:00
|
|
|
|
|
|
|
|
|
|
|
@client.event
|
|
|
|
async def on_ready():
|
|
|
|
print(f"Logged in as {client.user} (ID: {client.user.id})")
|
|
|
|
|
|
|
|
client.run(TOKEN)
|