forked from Raragyay/OU2020Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (19 loc) · 688 Bytes
/
main.py
File metadata and controls
32 lines (19 loc) · 688 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
30
31
32
from typing import List, Type
from discord.ext.commands import Bot, Cog
from cogs.command_restrictions_cog import CommandRestrictionsCog
from cogs.error_cog import ErrorCog
from cogs.test_cog import TestCog
def retrieve_token():
return open("cs25token.txt", "r").read().strip()
def load_cogs(bot: Bot, cogs_to_add: List[Type[Cog]]):
for cog in cogs_to_add:
cog_extension: str = cog.__module__
bot.load_extension(cog_extension)
command_prefix = "%"
cogs = [TestCog, CommandRestrictionsCog, ErrorCog]
client = Bot(command_prefix=command_prefix)
load_cogs(client, cogs)
@client.event
async def on_ready():
print("ready")
client.run(retrieve_token())