aboutsummaryrefslogtreecommitdiffstats
path: root/warmachine/addons/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'warmachine/addons/base.py')
-rw-r--r--warmachine/addons/base.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/warmachine/addons/base.py b/warmachine/addons/base.py
index e605c2c..0a02df7 100644
--- a/warmachine/addons/base.py
+++ b/warmachine/addons/base.py
@@ -3,6 +3,21 @@ import logging
3 3
4 4
5class WarMachinePlugin(object): 5class WarMachinePlugin(object):
6 def __init__(self): 6 def __init__(self, *args, **kwargs):
7 self._loop = asyncio.get_event_loop() 7 self._loop = asyncio.get_event_loop()
8 self.log = logging.getLogger(self.__class__.__name__) 8 self.log = logging.getLogger(self.__class__.__name__)
9
10 def recv_msg(self, *args, **kwargs):
11 """
12 Called when a connection receives a message. Arguments are
13 ``connection`` and ``message``.
14
15 ``connection`` is a :class:`warmachine.connections.base.Connection`
16 object used to interact with the connection to a chat server.
17 ``message`` is a dictionary that contains information about a message
18 that was received on the connection. See
19 :class:`warmachine.connections.base.Connection.read` for more
20 information.
21 """
22 raise NotImplementedError('{} must implement `recv_msg` method'.format(
23 self.__class__.__name__))