-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocumentation.lisp
114 lines (77 loc) · 2.8 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
104
105
106
107
108
109
110
111
112
113
114
(in-package #:org.shirakumo.maiden.agents.notify)
;; interface.lisp
(docs:define-docs
(type notify
"This agent implements an offline messaging system. It is useful for reminding people if they are not currently around.")
(function handle-note-notification
"This goes through all the notes for the user and replies to the even with each one of them, if the note's trigger matches the one given.
All applicable notes are removed.
See REMOVE-NOTE
See TRIGGER
See USER-NOTES")
(function handle-note-creation
"This handles the creation of a new note and takes care of some special cases.
No note is created if the target is empty or the
user themselves.
See MAKE-NOTE
See NORMALIZE-USER-NAME")
(command forget-notes
"Throws out all notes for yourself, or a specific user. Useful if you've already seen the notes, don't need them anymore, or addressed them to the wrong person.")
(command send-join-note
"Send a notification message that will be displayed as soon as the user joins a channel the bot is on again.")
(command send-note
"Send a notification message that will be displayed as soon as the user speaks again."))
;; notes.lisp
(docs:define-docs
(type note
"This class holds all relevant information for a notification.
Notes are a way of reminding another user of something
at a time where they're hopefully paying attention again.
After a note instance has been created, it is
automatically registered.
See ID
See FROM
See TO
See MESSAGE
See DATE
See TRIGGER
See MAKE-NOTE
See REGISTER-NOTE")
(function from
"Accessor to the source of the note.
See NOTE")
(function to
"Accessor to the recipient of the note.
See NOTE")
(function date
"Accessor to the universal-time that denotes the note's creation time.
See NOTE")
(function trigger
"Accessor to the note's trigger condition.
Can be one of
- :MESSAGE The note is sent out when the user next
writes a new message.
- :JOIN The note is sent out when the user next
joins a channel we can see.")
(function make-note
"Easily create a new note instance.
See NOTE")
(function next-note-id
"Create a new ID for a note.
This modifies the global note storage.
See MAIDEN-STORAGE:WITH-STORAGE")
(function normalize-user-name
"Normalize the username by converting it into a string and downcasing it.")
(function register-note
"Register a note in the notes storage.
This will ensure it is persisted to disk.
See MAIDEN-STORAGE:WITH-STORAGE")
(function remove-note
"Remove the note from the storage.
See MAIDEN-STORAGE:WITH-STORAGE")
(function clear-notes
"Clear all notes addressed to the given user.
See MAIDEN-STORAGE:WITH-STORAGE")
(function user-notes
"Retrieve a fresh list of all notes addressed to the user.
See MAIDEN-STORAGE:WITH-STORAGE"))