-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbot.py
45 lines (30 loc) · 953 Bytes
/
bot.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
38
39
40
41
42
43
44
45
import os
import nextcord
from nextcord.ext import commands
import core.classifier
import core.log as log
from core.faq import Store
from core.files import Config
config: Config = Config()
intents = nextcord.Intents.default()
intents.message_content = True
activity = nextcord.Activity(type=config.activity_type(), name=config.activity())
bot = commands.Bot(intents=intents, activity=activity)
store = core.faq.setup(Store(bot))
@bot.event
async def on_ready():
print("Bot is ready! - @Pterodactyl")
log.info('We logged in as', bot.user)
def load_extensions():
for fn in os.listdir("./cogs"):
if fn.endswith(".py"):
log.info(f"Loading extension: {fn}")
bot.load_extension(f"cogs.{fn[:-3]}")
def start():
log.load_logging_handlers()
load_extensions()
log.info("Loading classifiers...")
store.load_classifiers()
log.info("Starting bot...")
bot.run(config.token())
start()