selena/main.py
Dan 49a7588699 FEAT: Added XP
REF: Fixed up currency so the cooldown is presented to the user.
2024-06-24 23:20:03 -04:00

43 lines
1.0 KiB
Python

import discord
from config import config
TOKEN = config['DISCORD_TOKEN']
GUILD_ID = config['GUILD_ID']
intents = discord.Intents.default()
intents.messages = True
class Selena(discord.Client):
def __init__(self):
super().__init__(intents=intents)
self.tree = discord.app_commands.CommandTree(self)
self.load_modules()
def load_modules(self):
if config['modules']['currency']['enabled']:
from modules.user.currency import Currency
currency = Currency(self)
currency.setup(self.tree)
if config['modules']['xp']['enabled']:
from modules.user.xp import XP
xp = XP(self)
xp.setup(self.tree)
async def setup_hook(self):
self.tree.copy_global_to(guild=discord.Object(id=GUILD_ID))
await self.tree.sync(guild=discord.Object(id=GUILD_ID))
# Force sync for all commands
await self.tree.sync()
bot = Selena()
@bot.event
async def on_ready():
print(f'{bot.user.name} has connected to Discord!')
bot.run(TOKEN)