-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
57 lines (40 loc) · 1.35 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# Main Lib
import disnake as sweetness
from disnake.ext import commands
# Standart Import
from client import config
# Other Libs
from os import listdir
# Client
client = commands.Bot(
command_prefix = commands.when_mentioned,
help_command = None,
sync_commands_debug = True,
intents = sweetness.Intents.all()
)
# Other
async def get_stats():
return {
"guilds": len(client.guilds),
"users": len(set(client.get_all_members()))
}
# Events
@client.event
async def on_ready():
print("Ready")
await get_stats()
# Loading Moderation
for filename in listdir('./client/commands/moderation/'):
if filename.endswith('.py'):
client.load_extension(f'client.commands.moderation.{filename[:-3]}')
print(f"\033SweetNess \033COGS: \033[38;5;105m{filename[:-3]}\033has been loaded")
else:
if (filename != '__pycache__'):
for file in listdir(f'./client/commands/moderation/{filename}/'):
if file.endswith('.py'):
client.load_extension(f'client.commands.moderation.{filename}.{file[:-3]}')
print(f"\033SweetNess \033 COGS: \033{filename}.{file[:-3]}\033 has been loaded")
# Client Loading
client.run(config.SWEETNESS["TOKEN"])