-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocumentation.lisp
103 lines (71 loc) · 2.58 KB
/
documentation.lisp
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
(in-package #:org.shirakumo.maiden.agents.silly)
(docs:define-docs
(variable *silly-functions*
"This holds a map from names to silly functions.
A silly function should take two arguments, the first
being the name of the sender who sent the message, and
the second being a message text string.
The silly function should, if it wants to handle the
message, return a string which will be displayed to the
user.
See SILLY-FUNCTION
See REMOVE-SILLY-FUNCTION
See DISPATCH-SILLY
See DEFINE-SILLY")
(function silly-function
"Accessor to the silly function of the given name.
See *SILLY-FUNCTIONS*
See REMOVE-SILLY-FUNCTION")
(function remove-silly-function
"Removes the silly function of the given name.
See SILLY-FUNCTION
See *SILLY-FUNCTIONS*")
(function dispatch-silly
"Dispatch the sender and message to the silly functions and gather all resulting messages into a list.
See *SILLY-FUNCTIONS*")
(function define-silly
"Define a new silly function.
See *SILLY-FUNCTIONS*
See SILLY-FUNCTION")
(function define-simple-silly
"Define a simple silly function.
The message is matched against REGEX and the regex'
groups are destructured into the ARGS variables.
The body should then be a format string followed by
the format arguments.
See DEFINE-SILLY
See CL-PPCRE:REGISTER-GROUPS-BIND
See CL:FORMAT")
(function cut-to-first-vowel
"Cut the word up until the first vowel, if possible. If not, just return the whole word.")
(type silly
"This module implements silly commands and responses.")
(command eight
"8")
(command jerkcity
"Respond with a randomly selected jerkcity comic strip.")
(command roll
"Roll some dice. Note that this is not provided with the intention of providing gambling means.")
(command hello
"Greet the bot.")
(command present
"Give the bot something nice!")
(command you-are
"Tell the bot what it is.")
(command make
"Order the bot to make you something nice.")
(variable *fortunes*
"Holds a list of \"fortune\" messages.
Should be populated by the fortunes.txt file.
See FORTUNE")
(function fortune
"Pick a fortune message for a user of the given name at the given time.
The fortune to pick is decided on a hash of the time and name.
It is thus deterministic, but highly volatile. In order to make
it deterministic for a whole day, the timestamp is reduced to
a counter for days.
See *FORTUNES*")
(command fortune
"Display the fortune of today for you or for a user. It changes daily!")
(command tell
"Show someone else the output of a command."))