Elysia/main.py
Dan efc4ed6baf REF: Created the required files for the bot
FEAT: added the basic .env as well as a sample.env to allow people to clone
FEAT: Stores birthdays in SQL.
REF: Still need to add GDPR and other privacy related code.
2024-08-11 18:54:05 -04:00

46 lines
1.1 KiB
Python

from config import config
import discord
from logger import logger
logger.info("Starting EONA...")
TOKEN = config["TOKEN"]
intents = discord.Intents.default()
class EONA(discord.Client):
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"]:
from birthday import Birthday
birthday = Birthday(self)
birthday.setup(self.tree)
logger.info("Birthday module loaded")
except KeyError:
logger.error("Birthday module not enabled")
client = EONA()
@client.event
async def on_ready():
print(f"Logged in as {client.user} (ID: {client.user.id})")
client.run(TOKEN)