forked from CSSUoB/TeX-Bot-Py-V2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
31 lines (21 loc) · 784 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
"""
The main entrypoint into the running of the bot.
It loads the settings values from the .env file/the environment variables,
then ensures the Django database is correctly migrated to the latest version and finally begins
the asynchronous running process for the Discord bot.
"""
from collections.abc import Sequence
__all__: Sequence[str] = ("bot",)
import discord
import config
from config import settings
from utils import SuppressTraceback, TeXBot
with SuppressTraceback():
config.run_setup()
intents: discord.Intents = discord.Intents.default()
# noinspection PyDunderSlots,PyUnresolvedReferences
intents.members = True
bot = TeXBot(intents=intents)
bot.load_extension("cogs")
if __name__ == "__main__":
bot.run(settings["DISCORD_BOT_TOKEN"])