-
Notifications
You must be signed in to change notification settings - Fork 2
/
module.py
36 lines (28 loc) · 916 Bytes
/
module.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
class XMPPModule():
xmpp = None
priority = 0
terminate = False
# Default constructor. Try to avoid overriding __init__, use init() instead
def __init__(self, xmpp):
self.xmpp = xmpp
# Initialize the module. Use this, do not override __init__
def init(self):
pass
# User-implemented deconstructor called when a module is unloaded
def deinit(self):
pass
# Called when a message is received. Passes in whole message object
def recvMsg(self, msg):
self.handleMessage(msg)
# Called when a group message is received, useful for early separation
def recvGroupMsg(self, msg):
self.handleMessage(msg)
# Default, handle all messages the same
def handleMessage(self, msg):
pass
# Put some functionality on users sending a presence to a MUC
def handleMucPresence(self, presence):
pass
# Default help method
def help(self, bloop):
return 'This module does not implement a help method.'