FIX: Bot starts now.

DOC: Need to test commands and such, find problems.
This commit is contained in:
Dan 2024-06-18 23:44:13 -04:00
parent 69a3dfe8ba
commit 00f2748235
2 changed files with 5 additions and 14 deletions

BIN
bot.db Normal file

Binary file not shown.

19
main.py
View File

@ -1,10 +1,10 @@
import discord import discord
from discord.ext import commands from discord.ext import commands
import aiosqlite import aiosqlite
import asyncio
import os import os
import sys import sys
import subprocess import subprocess
import asyncio
from dotenv import load_dotenv from dotenv import load_dotenv
load_dotenv() load_dotenv()
@ -16,15 +16,13 @@ intents.message_content = True
intents.members = True intents.members = True
class Ariella(discord.Client): class Ariella(commands.Bot):
def __init__(self): def __init__(self):
super().__init__(intents=intents) super().__init__(command_prefix='!', intents=intents)
self.tree = discord.app_commands.CommandTree(self)
async def setup_hook(self): async def setup_hook(self):
await self.tree.sync()
# Load commands
await self.load_extension('commands') await self.load_extension('commands')
await self.tree.sync()
bot = Ariella() bot = Ariella()
@ -54,11 +52,4 @@ async def on_ready():
async def on_guild_join(guild): async def on_guild_join(guild):
await bot.tree.sync(guild=guild) await bot.tree.sync(guild=guild)
bot.run(TOKEN)
# Load commands
async def load_commands():
await bot.load_extension('commands')
asyncio.run(load_commands())
bot.run('TOKEN')