-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.py
27 lines (22 loc) 路 850 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
from os import listdir
from termcolor import colored
from classes.site import Site
from classes.logger import Logger
# Bot template written by Alex Gompper, available under MIT license @ https://github.com/alxgmpr/BotTemplate
# Please don't remove this credit. If you like what I've done here, or make something cool with it, shout me out!
# twitter: @edzart
def main():
log = Logger('M').log
log(colored('main bot template made by Alex Gompper @edzart', 'green'))
threads = []
i = 0
for config in listdir('tasks'):
if config in {'task.example.json'}: # configs to ignore
pass
else:
log('loading thread {} with config {}'.format(i, config))
threads.append(Site(i, 'tasks/' + config))
threads[i].start()
i += 1
if __name__ == '__main__':
main()