-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocumentation.lisp
118 lines (80 loc) · 2.98 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
115
116
117
118
(in-package #:org.shirakumo.maiden.agents.throttle)
(docs:define-docs
(type throttle
"Provides throttling to prevent spamming the bot with commands.")
(function attempts
"Accessor to the number of attempts that can be made within a time-frame.
See THROTTLE
See TIME-FRAME")
(function time-frame
"Accessor to the number of seconds that specify a time-frame for throttling.
See THROTTLE
See ATTEMPTS")
(function cooldown-function
"Accessor to the symbol that designates a cooldown function used to calculate the number of seconds until the user is freed.
Must be one of the following:
- :CONSTANT The cooldown is as much as the cooldown step.
- :LINEAR The cooldown is increased linearly for each
additional attempt within the cooldown.
- :EXPONENTIAL The cooldown is increased exponentially for
each additional attempt within the cooldown.
See THROTTLE
See COOLDOWN-STEP
See COOLDOWN-MAX")
(function cooldown-step
"Accessor to the step used to increase the cooldown according to the cooldown function.
See THROTTLE
See COOLDOWN-FUNCTION
See COOLDOWN-MAX")
(function cooldown-max
"Accessor to the maximum amount of seconds that the user can be held in cooldown.
See THROTTLE
See COOLDOWN-FUNCTION
See COOLDOWN-STEP")
(function records
"Accessor to the hash table associating user names to throttling records.
See THROTTLE
See RECORD")
(function record
"Access the throttling record for the given user.
See RECORDS
See THROTTLE")
(type record
"Container class to hold information about the throttling of a user.
See ATTEMPTS
See TIMESTAMP
See TIMEOUT")
(function attempts
"The current number of attempts that have been made by the user within the time-frame.
See RECORD")
(function timestamp
"The universal-time timestamp that specifies the time at which the timeframe began or the timeout began.
See RECORD")
(function timeout
"The number of seconds for which the user has been timed out.
This is relative to TIMESTAMP.
See RECORD")
(function clear-tax
"Clear the tax on the user's record.
This effectively makes them unthrottled.
See RECORD")
(function tax
"This function taxes the user for one attempt.
If too many attempts have been made too quickly, the user is
timed out. If further attempts are made while timed out, the
timeout is increased gradually according to the throttle's
timeout function and step. Once the user has passed their
timeout, the tax is cleared again.
See THROTTLE
See RECORD")
(function ensure-cooldown-function
"Ensure that the given thing designates a valid cooldown function.
Returns the cooldown function symbol.
If it is not a valid designator, an error is signalled.
See COOLDOWN-FUNCTION")
(command view-config
"Shows the current configuration that the throttling works with.")
(command set-config
"Update the configuration values for the throttling behaviour.")
(command clear-tax
"Clear the throttling tax from a user."))