-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathmain.py
34 lines (24 loc) · 799 Bytes
/
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
import os
import dotenv
import jishaku
import discord
from discord.ext import commands
from command.database.loader import db_load, db_loaded, client_load, client_loaded
# loading env file so that we can use it
dotenv.load_dotenv()
def main():
db_load() # loads database
db = db_loaded()
client_load()
client = client_loaded()
# to load all cogs
for folder in os.listdir("command"):
if os.path.exists(os.path.join("command", folder)):
for filename in os.listdir(f"./command/{folder}"):
if filename.endswith(".py"):
client.load_extension(f"command.{folder}.{filename[:-3]}")
# loading "jishaku"
client.load_extension("jishaku")
client.run(os.getenv("TOKEN"))
if __name__ == "__main__":
main()