-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathskeleton.py
78 lines (60 loc) · 2.25 KB
/
skeleton.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from errbot import BotPlugin, botcmd, webhook
class Skeleton(BotPlugin):
"""
Fill in your plugin description here.
"""
def activate(self):
"""
Triggers on plugin activation
You should delete it if you're not using it to override any default behaviour
"""
super(Skeleton, self).activate()
def deactivate(self):
"""
Triggers on plugin deactivation
You should delete it if you're not using it to override any default behaviour
"""
super(Skeleton, self).deactivate()
def get_configuration_template(self):
"""
Defines the configuration structure this plugin supports
You should delete it if your plugin doesn't use any configuration like this
"""
return {
"EXAMPLE_KEY_1": "Example value",
"EXAMPLE_KEY_2": ["Example", "Value"],
}
def check_configuration(self, configuration):
"""
Triggers when the configuration is checked, shortly before activation
You should delete it if you're not using it to override any default behaviour
"""
super(Skeleton, self).check_configuration()
def callback_connect(self):
"""
Triggers when bot is connected
You should delete it if you're not using it to override any default behaviour
"""
pass
def callback_message(self, message):
"""
Triggered for every received message that isn't coming from the bot itself
You should delete it if you're not using it to override any default behaviour
"""
pass
def callback_botmessage(self, message):
"""
Triggered for every message that comes from the bot itself
You should delete it if you're not using it to override any default behaviour
"""
pass
@webhook
def example_webhook(self, incoming_request):
"""A webhook which simply returns 'Example'"""
return "Example"
# Passing split_args_with=None will cause arguments to be split on any kind
# of whitespace, just like Python's split() does
@botcmd(split_args_with=None)
def example(self, mess, args):
"""A command which simply returns 'Example'"""
return "Example"