forked from BoredManCodes/1MBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
34 lines (25 loc) · 986 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
import os
from dotenv import load_dotenv
from naff import Intents
from naff.ext.debug_extension import DebugExtension
from core.init_logging import init_logging
from core.base import CustomClient
from core.extensions_loader import load_extensions
if __name__ == "__main__":
# load the environmental vars from the .env file
load_dotenv()
# initialise logging
init_logging()
# create our bot instance
bot = CustomClient(
intents=Intents.DEFAULT, # intents are what events we want to receive from discord, `DEFAULT` is usually fine
auto_defer=True, # automatically deferring interactions
# activity="Not sure yet", # the status message of the bot
)
# load the debug extension if that is wanted
if os.getenv("LOAD_DEBUG_COMMANDS") == "true":
DebugExtension(bot=bot)
# load all extensions in the ./extensions folder
load_extensions(bot=bot)
# start the bot
bot.start(os.getenv("DISCORD_TOKEN"))