forked from gmoomau/rekrvn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
31 lines (23 loc) · 1.14 KB
/
README
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
rekrvn
==============
a bot. pretty buggy.
Usage
--------------
list modules you want enabled in config.clj
eg. "example" will enable modules/example.clj
"irc.client" will enable modules/irc/client.clj
See complete example in config.clj.example
Writing a Module
--------------
(:require rekrvn.hub)
publish events via (rekrvn.hub/broadcast content replyfn)
- content is a string beginning with a one-word identifier for your module
- replyFn is a function to be used by other modules in order to respond to published events
It takes two arguments, modId and msg. modId is a string name for the module calling replyFn and msg is the module's response.
For example, the irc module provides a replyFn that sends message to the channel from which
the message originated.
subscribe to events/messages via (rekrvn.hub/addListener modname matcher actFn)
- modname is the name of the module adding the listener
- matcher is an re-pattern to match applicable publications
- actFn is the function to be called on matching publications. As arguments, it takes a list containing the parenthesized groups in matcher and a replyFn.
See modules/example.clj for examples.