-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (19 loc) · 757 Bytes
/
main.py
File metadata and controls
29 lines (19 loc) · 757 Bytes
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
import disnake, argparse, os
from disnake.ext import commands
from core.enums import Bot
bot = commands.InteractionBot(intents=disnake.Intents.default(), test_guilds=Bot.GUILDS)
@bot.event
async def on_ready():
print(f"[ONLINE] {bot.user} ({bot.user.id})")
COG_TREE = filter(lambda dir: not "__pycache__" in dir[0] ,os.walk("cogs"))
for cog in COG_TREE:
dir = cog[0] #.replace("\\", ".")
bot.load_extensions(dir)
print("Loaded Cogs:", ', '.join(cog[-1]))
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--dev", dest="dev", action="store_true")
args = parser.parse_args()
token = Bot.TOKEN if not args.dev else Bot.DEV_TOKEN
if args.dev: print("DEV MODE ON")
bot.run(token)