-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.py
27 lines (22 loc) · 846 Bytes
/
index.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
import os
import discord
from utils import default
from utils.data import Bot, HelpFormat
config = default.config()
print("Logging in...")
bot = Bot(
command_prefix=config["prefix"], prefix=config["prefix"],
owner_ids=config["owners"], command_attrs=dict(hidden=True), help_command=HelpFormat(),
allowed_mentions=discord.AllowedMentions(roles=False, users=True, everyone=False),
intents=discord.Intents( # kwargs found at https://discordpy.readthedocs.io/en/latest/api.html?highlight=intents#discord.Intents
guilds=True, members=True, messages=True, reactions=True, presences=True
)
)
for file in os.listdir("cogs"):
if file.endswith(".py"):
name = file[:-3]
bot.load_extension(f"cogs.{name}")
try:
bot.run(config["token"])
except Exception as e:
print(f'Error when logging in: {e}')