27 lines
630 B
Python
27 lines
630 B
Python
from dotenv import load_dotenv
|
|
load_dotenv() # MUST be first
|
|
|
|
import discord
|
|
from discord import app_commands
|
|
import os
|
|
|
|
from db import init_db
|
|
from commands import register
|
|
|
|
class Momentum(discord.Client):
|
|
def __init__(self):
|
|
super().__init__(intents=discord.Intents.default())
|
|
self.tree = app_commands.CommandTree(self)
|
|
|
|
async def setup_hook(self):
|
|
register(self.tree)
|
|
await self.tree.sync()
|
|
print("🌐 Commands synced")
|
|
|
|
async def on_ready(self):
|
|
print(f"🔥 Momentum online as {self.user}")
|
|
init_db()
|
|
|
|
bot = Momentum()
|
|
bot.run(os.getenv("DISCORD_TOKEN"))
|