-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
40 lines (33 loc) · 992 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
35
36
37
38
39
40
"""
Master class of the MAD discord Bot
"""
import logging
from src.reactor.actions import Reactor
from src.core.harmony import Harmony
from src.habits.habits import Habits
class MADBot():
"""
Container class to hold all of the MAD Bot's functionality classes.
"""
def __init__(self):
self.logger = logging.getLogger("MADBot")
#self.logger.setLevel(logging.INFO)
self.harmony = Harmony(on_message_callback=self.react)
self.reactor = Reactor(self)
self.harmony.activate()
self.habits = Habits(self.harmony)
async def react(self, delta):
"""
React to a sensory input.
:param obj delta: state change
:returns: any response to the input from the context
:rtype: obj
"""
print("Channel:")
print(delta.channel.id)
return await self.reactor.process(delta)
def launch():
"""
Launch function as defined by AIGIS conventions.
"""
MADBot()