blob: 0a02df78c0688415851cf6233c8b004ef4a8e3f5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import asyncio
import logging
class WarMachinePlugin(object):
def __init__(self, *args, **kwargs):
self._loop = asyncio.get_event_loop()
self.log = logging.getLogger(self.__class__.__name__)
def recv_msg(self, *args, **kwargs):
"""
Called when a connection receives a message. Arguments are
``connection`` and ``message``.
``connection`` is a :class:`warmachine.connections.base.Connection`
object used to interact with the connection to a chat server.
``message`` is a dictionary that contains information about a message
that was received on the connection. See
:class:`warmachine.connections.base.Connection.read` for more
information.
"""
raise NotImplementedError('{} must implement `recv_msg` method'.format(
self.__class__.__name__))
|