-
Notifications
You must be signed in to change notification settings - Fork 2
/
HACKING
36 lines (27 loc) · 1.8 KB
/
HACKING
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
=== The Message Flow ===
message +-------------+ No +------+
(Some User Frontend) -----------> | parser0 | ----> (Action?) ------> | Chat | ---> User
+-------------+ | +------+
| |
+----------------+ | yes | +--------------+
| Action Storage | <--+ +<--+ Chat Service |
+----------------+ +--------------+
read |
+------------------+ | +--> Commnad Bot
| SplashBox Daemon |--->----------------->--+-----> (Take Action)--+--> IM Bot ----> User
+------------------+ +--> Others...
=== How to Create a Bot ===
* Create your new own bot is extremely easy!
* The following we will create a bot named "yobot" triggered by the action "yo"
* To create an action "yo" and point it to "yobot", run the command:
./scripts/splashbox-action-creator "Your Name" [email protected] yo yobot 0.0.1
* Copy echobot to yobot as a template.
cp ./action/echobot ./action/yobot
* Now edit your new bot to design what it will do for you.
vim ./action/yobot
* Your bot will be triggered by "./scripts/splashbox-parser0 yo MESSAGES" and take MESSAGES as the arguments.
** (Make sure splashbox-daemon is running)
=== Developer Mode ===
* In SplashBox.pm, modify $IS_DEV to 1 to turn on developer mode.
* In developer mode, the splashbox-daemon check current dir instead of /var/lib/splashbox
* Also please remember to overwrite the PERLLIB environment variable when necessary.