-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
37 lines (28 loc) · 859 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
### External Imports
import discord, os
from discord import app_commands
### Internal Imports
# Core
from src.Bot import Bot
from src.on_ready import on_ready
from src.core_config import load_the_commands
# Logic to pull from .env
from dotenv import load_dotenv
load_dotenv()
DISCORD_TOKEN = os.environ.get("DISCORD_TOKEN")
MANAGEMENT_CHANNEL = os.environ.get("MANAGEMENT_CHANNEL")
# Brain/Bot State
bot = Bot()
class myclient(discord.Client):
def __init__(self, intents):
super().__init__(intents=intents)
self.synced = False
# Load Bot
async def on_ready_event():
await on_ready(client, tree, bot, MANAGEMENT_CHANNEL)
intents=discord.Intents.default()
client = myclient(intents=intents)
tree = app_commands.CommandTree(client)
client.on_ready = on_ready_event
load_the_commands(client, tree, bot)
client.run(DISCORD_TOKEN)