-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
54 lines (41 loc) · 1.43 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import disnake
from disnake.ext import commands
import view.console_out
import random
from dotenv import load_dotenv
import os
from controller import debug, botcommands, events, testing, eastereggs, mafia
from view import classes, console_out
def connect(module):
try:
bot.load_extension(module)
return 1
except disnake.ext.commands.errors.ExtensionNotFound:
console_out.error(f"No connection to {module}")
return 0
nummodules = 5
load_dotenv()
PREFIX = '/'
intents = disnake.Intents().all()
TOKEN = os.getenv('TOKEN')
connections = 0
bot = commands.Bot(command_prefix=PREFIX, help_command=None, intents=intents, test_guilds=[1175855563444330637, 715142906658422796, 1222366560463618120])
# подключение модулей
connections += connect("controller.botcommands")
connections += connect("controller.debug")
# connections += connect("controller.events")
# connections += connect("controller.testing")
connections += connect("controller.mafia")
connections += connect("controller.eastereggs")
# connections += classes.connected()
connections += console_out.connected()
# Number of successful module connections
if connections >= nummodules:
console_out.important("All modules connected!")
else:
console_out.warning("Some modules cannot be connected!")
@bot.event
async def on_ready():
view.console_out.important("Bot started, ready to work!")
if __name__ == '__main__':
bot.run(TOKEN)