-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
41 lines (29 loc) · 1.18 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
from bot import CustomBot
from cli_commands.exit import exit_command
from cli_commands.handout import handout_command
from cli_commands.info import info_command
from config import ConfigurationManager
discord_bot = CustomBot()
@discord_bot.event
async def on_ready():
print(f"Logged in as {discord_bot.user} ({discord_bot.user.id})")
while True:
input_data = input("$ ")
split_data = input_data.split(" ")
match split_data[0]:
case "exit":
return await exit_command(discord_bot, *split_data[1:])
case "info":
# patreon info given a discord ID
await info_command(discord_bot, *split_data[1:])
case "handout":
# handout roles to all patrons that are entitled to them and removes roles from those who are not
await handout_command(discord_bot, *split_data[1:])
case "help":
print("TODO: not implemented")
case _:
print("Unknown command")
if __name__ == '__main__':
config = ConfigurationManager().get_config()
print("Starting bot...")
discord_bot.run(config["discord_access_token"])