-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.py
More file actions
55 lines (39 loc) · 1.4 KB
/
Main.py
File metadata and controls
55 lines (39 loc) · 1.4 KB
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
53
54
import discord
import os
from discord.ext import commands
from colorama import Fore
client = commands.Bot(command_prefix='mh:'.lower())
@client.event
async def on_ready():
print(Fore.GREEN + "Successful login" + Fore.WHITE)
return 'successful'
extensions = ['MsgHandler']
cmd_extn = ['CmdHandler', 'YouTube']
# TODO: Twitch live status of broadcaster •
# TODO: YouTube return random video •
# TODO: Something else I cannot think of right now
if __name__ == '__main__':
print("Loading message handler extensions")
sucess = 0
failed = 0
for msg_ext in extensions:
print(f"loading {msg_ext}")
try:
client.load_extension('Messages.Handle.Comms.' + msg_ext)
print(Fore.GREEN + f"Successfully loaded {msg_ext}!" + Fore.WHITE)
sucess =+ 1
except Exception as err:
print(Fore.RED + '-'*150 + f"\n'{msg_ext}' was not able to load: {err}\n" + "-"*150 + Fore.WHITE)
failed += 1
print("Loading admin command messages")
for cmd in cmd_extn:
print(f"loading cmd file {cmd}")
try:
client.load_extension('Messages.Handle.Commands.' + cmd)
print(Fore.GREEN + f"Successfully loaded {cmd}!" + Fore.WHITE)
sucess += 1
except Exception as err:
print(Fore.RED + '-'*150 + f"\n'{cmd}' was not able to load: {err}\n" + "-"*150 + Fore.WHITE)
failed += 1
print(Fore.GREEN + f'{sucess} extensions loaded success fully. ' + Fore.RED + f'{failed} failed to load.')
client.run('No looky')