-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
52 lines (41 loc) · 1.46 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
import os
import jishaku
import discord
from discord.ext import commands
from akito import Token
try:
import uvloop
import asyncio
except ImportError:
pass
def main():
bot = commands.Bot(
case_insensitive = True,
strip_after_prefix = True,
intents= discord.Intents.default(),
command_prefix= commands.when_mentioned,
)
bot.remove_command("help")
for folder in os.listdir("extension"):
if os.path.exists(os.path.join("extension", folder)):
for filename in os.listdir(f"extension/{folder}"):
# afaik, i excluded these folders as the cogs inside them
# were still under transistion from text command to slash command,
# but i didn't make the changes because i was occupied with some stuff
if folder in ["genshin",'roleplay','image','nsfw']:
pass
else:
if filename.endswith(".py"):
bot.load_extension(f"extension.{folder}.{filename[:-3]}")
bot.unload_extension('extension.fun.tictactoe') # i unloaded this one too, because i had to update some stuff in it, idr that anymore lol
bot.load_extension("jishaku")
print(f"Loaded {len(bot.extensions)}")
bot.run(Token.bot.value)
if __name__ == "__main__":
try:
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
uvloop.install()
except:
pass
finally:
main()