|
|
@@ -4,9 +4,6 @@ Rocketbot's functionality is broken into different functional areas that
|
|
4
|
4
|
typically have a master switch to enable/disable it and some other configuration.
|
|
5
|
5
|
Configuration is specific to each server the bot is invited to.
|
|
6
|
6
|
|
|
7
|
|
-For all the examples here, I'm assuming the default command prefix of `$rb_`.
|
|
8
|
|
-If you set a different one in `config.py`, translate accordingly.
|
|
9
|
|
-
|
|
10
|
7
|
## Log channel
|
|
11
|
8
|
|
|
12
|
9
|
The first thing you'll want to do is configure a channel where bot messages
|
|
|
@@ -14,7 +11,7 @@ can go. This should be a channel only mods can see. Go into that channel and
|
|
14
|
11
|
type
|
|
15
|
12
|
|
|
16
|
13
|
```
|
|
17
|
|
-$rb_config setwarningchannel
|
|
|
14
|
+/config setwarningchannel
|
|
18
|
15
|
```
|
|
19
|
16
|
|
|
20
|
17
|
This ensures warnings will go somewhere appropriate.
|
|
|
@@ -23,7 +20,7 @@ You will probably also want to set a role to tag for important warnings to get
|
|
23
|
20
|
their attention. E.g. to tag the `@Mod` role type
|
|
24
|
21
|
|
|
25
|
22
|
```
|
|
26
|
|
-$rb_config setwarningmention @Mod
|
|
|
23
|
+/config setwarningmention @Mod
|
|
27
|
24
|
```
|
|
28
|
25
|
|
|
29
|
26
|
Entering that will configure who to mention, and it will also mention them right
|
|
|
@@ -33,69 +30,42 @@ bothered and explain you were just configuring a cool new bot.
|
|
33
|
30
|
## Help!!
|
|
34
|
31
|
|
|
35
|
32
|
I don't remember the commands for my own bot, so I don't expect you will either.
|
|
36
|
|
-The only thing you need to remember is `$rb_help`. The bot will reply with a
|
|
37
|
|
-summary of all the top-level commands available. As an example:
|
|
38
|
|
-
|
|
39
|
|
-```
|
|
40
|
|
-Auto Kick:
|
|
41
|
|
- autokick Automatically kicks all new users as soon as they join
|
|
42
|
|
-Configuration:
|
|
43
|
|
- config Manages general bot configuration
|
|
44
|
|
-Crosspost Detection:
|
|
45
|
|
- crosspost Manages crosspost detection and handling
|
|
46
|
|
-General:
|
|
47
|
|
- deletemessages Mass deletes messages
|
|
48
|
|
- hello Simple test reply
|
|
49
|
|
- shutdown Shuts down the bot
|
|
50
|
|
- testwarn Posts a test warning
|
|
51
|
|
-Join Age:
|
|
52
|
|
- joinage Tracks recently joined users with options to mass kick or ban
|
|
53
|
|
-Join Raids:
|
|
54
|
|
- joinraid Manages join raid detection and handling
|
|
55
|
|
-Logging:
|
|
56
|
|
- logging Manages event logging
|
|
57
|
|
-Pattern Matching:
|
|
58
|
|
- pattern Manages message pattern matching
|
|
59
|
|
-URL Spam:
|
|
60
|
|
- urlspam Manages URL spam detection
|
|
61
|
|
-Username Pattern:
|
|
62
|
|
- username Manages username pattern detection
|
|
63
|
|
-No Category:
|
|
64
|
|
- help Shows this message
|
|
65
|
|
-
|
|
66
|
|
-Type $rb_help command for more info on a command.
|
|
67
|
|
-You can also type $rb_help category for more info on a category.
|
|
68
|
|
-```
|
|
69
|
|
-
|
|
70
|
|
-Each section is known internally as a "cog". If you're mucking around in the code,
|
|
71
|
|
-each cog is its own source file in the `rocketbot/cogs` directory. But you can
|
|
72
|
|
-just think of them as categories. Some of these are commands of their own (e.g.
|
|
73
|
|
-`hello`, invoked with `$rb_hello`) but most have subcommands. You can find out
|
|
74
|
|
-more using `$rb_help commandname`, e.g. `$rb_help config` will show subcommands for
|
|
|
33
|
+The only thing you need to remember is `/help`. Typing the command alone will show
|
|
|
34
|
+a top-level list of commands available. You can optionally search for commands
|
|
|
35
|
+or keywords by typing `/help <keywords>`. As you type, matching suggestions will
|
|
|
36
|
+appear in an autocomplete list. You can search for commands, subcommands, modules,
|
|
|
37
|
+or keywords.
|
|
|
38
|
+
|
|
|
39
|
+Each section is known internally as a "cog," though I try to refer to them as
|
|
|
40
|
+"modules" externally to be a little less jargony. If you're mucking around in
|
|
|
41
|
+the code, each cog is its own source file in the `rocketbot/cogs` directory.
|
|
|
42
|
+But you can just think of them as categories. Some of these are top-level commands
|
|
|
43
|
+(e.g. `/hello`) but most have subcommands. You can find out more using
|
|
|
44
|
+`/help <commandname>`, e.g. `/help config` will show subcommands for
|
|
75
|
45
|
config.
|
|
76
|
46
|
|
|
77
|
|
-```
|
|
78
|
|
-$rb_config
|
|
|
47
|
+And then you can invoke a subcommand with `/commandname subcommandname`. e.g.
|
|
|
48
|
+`/config setwarningchannel`. To get more info about a subcommand, use `/help`
|
|
|
49
|
+again. e.g. `/help /config setwarningchannel`.
|
|
79
|
50
|
|
|
80
|
|
-General guild configuration command group
|
|
|
51
|
+## Configuration
|
|
81
|
52
|
|
|
82
|
|
-Commands:
|
|
83
|
|
- getwarningchannel Shows the mod warning channel
|
|
84
|
|
- getwarningmention Shows the user/role to mention in warning messages
|
|
85
|
|
- setwarningchannel Sets the mod warning channel
|
|
86
|
|
- setwarningmention Sets a user/role to mention in warning messages
|
|
|
53
|
+There are four top-level commands used for configuring most functionality.
|
|
87
|
54
|
|
|
88
|
|
-Type $rb_help command for more info on a command.
|
|
89
|
|
-You can also type $rb_help category for more info on a category.
|
|
90
|
|
-```
|
|
|
55
|
+- `/get <setting>` - Shows the current value for a configuration setting.
|
|
|
56
|
+- `/set <setting> <new_value>` - Sets a new value.
|
|
|
57
|
+- `/enable <module>` - Enables a module.
|
|
|
58
|
+- `/disable <module>` - Disables a module.
|
|
|
59
|
+
|
|
|
60
|
+You can also use
|
|
91
|
61
|
|
|
92
|
|
-And then you can invoke a subcommand with `$rb_commandname subcommandname`. e.g.
|
|
93
|
|
-`$rb_config setwarningchannel`. To get more info about a subcommand, use `$rb_help`
|
|
94
|
|
-again. e.g. `$rb_help config setwarningchannel`.
|
|
|
62
|
+- `/get all` - Shows all configuration settings and their current values.
|
|
95
|
63
|
|
|
96
|
64
|
## Cogs
|
|
97
|
65
|
|
|
98
|
|
-This section goes through each cog, what it does, and how to use it.
|
|
|
66
|
+This section goes through each cog, what it does, and how to use it. While I
|
|
|
67
|
+will try to keep this document up to date, the most authoritative info is via
|
|
|
68
|
+the `/help` command since that info lives right there with the code.
|
|
99
|
69
|
|
|
100
|
70
|
### Autokick
|
|
101
|
71
|
|
|
|
@@ -106,10 +76,10 @@ joins, and there was no other way to stop them. Obviously something you want to
|
|
106
|
76
|
supervise and disable as soon as the threat has passed.
|
|
107
|
77
|
|
|
108
|
78
|
Subcommands
|
|
109
|
|
-- `enable`/`disable` - Toggle autokicking
|
|
110
|
|
-- `getbancount`/`setbancount` - If the same person keeps rejoining after being
|
|
|
79
|
+- `/enable` or `/disable autokick` - Toggle autokicking
|
|
|
80
|
+- `/get` or `/set autokick_bancount` - If the same person keeps rejoining after being
|
|
111
|
81
|
kicked, ban them after this many rejoins.
|
|
112
|
|
-- `getofflineonly`/`setofflineonly` - Whether to only kick users who join with
|
|
|
82
|
+- `/get` or `/set autokick_offlineonly` - Whether to only kick users who join with
|
|
113
|
83
|
a status of offline. That's not impossible in ordinary use, but it's
|
|
114
|
84
|
suspect and likely indicative of bots versus real users.
|
|
115
|
85
|
|
|
|
@@ -118,13 +88,27 @@ Subcommands
|
|
118
|
88
|
General config that isn't specific to one cog.
|
|
119
|
89
|
|
|
120
|
90
|
Subcommands
|
|
121
|
|
-- `getwarningchannel`/`setwarningchannel` - Determines the channel where log
|
|
|
91
|
+- `/config get_warning_channel` or `set_warning_channel` - Determines the channel where log
|
|
122
|
92
|
messages are posted. Setting the warning channel doesn't take an argument; it
|
|
123
|
93
|
uses the current channel you typed the command in.
|
|
124
|
|
-- `getwarningmention`/`setwarningmention` - The user or role you want tagged when
|
|
|
94
|
+- `/config get_warning_mention` or `set_warning_mention` - The user or role you want tagged when
|
|
125
|
95
|
the bot needs to alert someone of suspicious activity. Needs to be a proper
|
|
126
|
96
|
autocompleted @ mention, not just the name.
|
|
127
|
97
|
|
|
|
98
|
+### Bang Commands
|
|
|
99
|
+
|
|
|
100
|
+Bang commands are one-word chat commands starting with an exclamation (a "bang")
|
|
|
101
|
+similar to what Twitch bots use. When a user types the command by itself in a
|
|
|
102
|
+message, the bot will respond with the configured text. E.g. a `!rules` command
|
|
|
103
|
+can be defined that summarizes the guild rules, and typing `!rules` in chat
|
|
|
104
|
+will get a reply with the list of rules.
|
|
|
105
|
+
|
|
|
106
|
+Subcommands
|
|
|
107
|
+- `/command define` - Defines a command or redefines an existing one.
|
|
|
108
|
+- `/command undefine` - Deletes a previously created command.
|
|
|
109
|
+- `/command list` - Lists all defined commands.
|
|
|
110
|
+- `/command invoke` - Silently invokes a bang command without typing anything visible in chat
|
|
|
111
|
+
|
|
128
|
112
|
### Crosspost detection
|
|
129
|
113
|
|
|
130
|
114
|
Detects an extremely common pattern we see of someone joining and copy/pasting
|
|
|
@@ -134,15 +118,15 @@ multiple channels, and if it exceeds the configured number within the configured
|
|
134
|
118
|
time span, it's ban hammer time.
|
|
135
|
119
|
|
|
136
|
120
|
Subcommands
|
|
137
|
|
-- `enable`/`disable` - Master toggle for this entire feature.
|
|
138
|
|
-- `getwarncount`/`setwarncount` - How many duplicate messages will cause a
|
|
|
121
|
+- `/enable` or /`disable crosspost` - Master toggle for this entire feature.
|
|
|
122
|
+- `/get` or `/set crosspost_warncount` - How many duplicate messages will cause a
|
|
139
|
123
|
warning message to be posted that alerts the mods.
|
|
140
|
|
-- `getbancount`/`setbancount` - How many duplicate messages should result in an
|
|
|
124
|
+- `/get` or `/set crosspost_bancount` - How many duplicate messages should result in an
|
|
141
|
125
|
automatic ban. Should be greater than the warning count.
|
|
142
|
|
-- `gettimespan`/`settimespan` - Sets the time window within which to look for
|
|
|
126
|
+- `/get` or `/set crosspost_timespan` - Sets the time window within which to look for
|
|
143
|
127
|
duplicates. Value is in seconds. Spammers usually fire these off very quickly,
|
|
144
|
128
|
so a minute or less is more than enough.
|
|
145
|
|
-- `getminlength`/`setminlength` - For text-only messages, sets the minimum length
|
|
|
129
|
+- `/get` or `/set crosspost_minlength` - For text-only messages, sets the minimum length
|
|
146
|
130
|
to be considered for duplicate detection. Maybe a benign (but annoying) user
|
|
147
|
131
|
posts "lol" at everything in multiple channels. Use this to filter for that
|
|
148
|
132
|
case.
|
|
|
@@ -152,33 +136,19 @@ Subcommands
|
|
152
|
136
|
These are just general top-level commands, not subcommands.
|
|
153
|
137
|
|
|
154
|
138
|
Commands
|
|
155
|
|
-- `deletemessages <@user> <timespan>` - Manually deletes a bunch of messages by a
|
|
|
139
|
+- `/delete_messages <@user> <timespan>` - Manually deletes a bunch of messages by a
|
|
156
|
140
|
particular user. Useful if you banned but accidentally forgot to delete
|
|
157
|
141
|
recent history, or to clean up after someone had a bit of a manic posting
|
|
158
|
142
|
spree. The timespan is a value like "30s" for 30 seconds, "5m" for 5
|
|
159
|
143
|
minutes, or "1h30m" for an hour and a half. NOTE: This only works for fairly
|
|
160
|
144
|
recent messages. You can't use it to delete things posted way back in the
|
|
161
|
145
|
scrollback.
|
|
162
|
|
-- `hello` - Just for testing bot responsiveness. Or a desperate need to be seen.
|
|
163
|
|
-- `shutdown` - Terminates the bot. I forgot this was here. I've never needed it.
|
|
|
146
|
+- `/hello` - Just for testing bot responsiveness. Or a desperate need to be seen.
|
|
|
147
|
+- `/shutdown` - Terminates the bot. I forgot this was here. I've never needed it.
|
|
164
|
148
|
If somehow the bot goes rogue and you're not there to ctrl+C it, use this.
|
|
165
|
|
-- `testwarn` - Posts a test mod warning in the configured warning channel with
|
|
|
149
|
+- `/testwarn` - Posts a test mod warning in the configured warning channel with
|
|
166
|
150
|
the configured mention user/role.
|
|
167
|
151
|
|
|
168
|
|
-### Join age
|
|
169
|
|
-
|
|
170
|
|
-This cog isn't really needed any more since the Members tab was added to Discord.
|
|
171
|
|
-It's used for seeing who joined most recently. The list of recent joins is only
|
|
172
|
|
-kept in memory, and it keeps a limited number, so it's really only useful for
|
|
173
|
|
-the past few days.
|
|
174
|
|
-
|
|
175
|
|
-Subcommands
|
|
176
|
|
-- `enable`/`disable` - Toggle join tracking.
|
|
177
|
|
-- `getjointime`/`setjointime` - How long to track a join, in seconds.
|
|
178
|
|
-- `search <timespan>` - Shows all users who joined in the last x length of time.
|
|
179
|
|
- Values are like `30s` for 30 seconds, `5m` for 5 minutes, `1h30m` for an hour
|
|
180
|
|
- and a half, etc.
|
|
181
|
|
-
|
|
182
|
152
|
### Join raids
|
|
183
|
153
|
|
|
184
|
154
|
While not as common in the past year or two, we used to get a suspicious number
|
|
|
@@ -187,9 +157,9 @@ by users being spammed in DMs by them. This cog attempts to alert us to such
|
|
187
|
157
|
spikes in joins.
|
|
188
|
158
|
|
|
189
|
159
|
Subcommands
|
|
190
|
|
-- `enable`/`disable` - Toggle the feature.
|
|
191
|
|
-- `getjoincount`/`setjoincount` - Sets the minimum number of suspicious joins.
|
|
192
|
|
-- `getjointime`/`setjointime` - Sets the span of time that number of joins must
|
|
|
160
|
+- `/enable` or `/disable joinraid` - Toggle the feature.
|
|
|
161
|
+- `/get` or `/set joinraid_joincount` - Sets the minimum number of suspicious joins.
|
|
|
162
|
+- `/get` or `/set joinraid_jointime` - Sets the span of time that number of joins must
|
|
193
|
163
|
occur to be suspicious, in seconds.
|
|
194
|
164
|
|
|
195
|
165
|
### Logging
|
|
|
@@ -201,7 +171,7 @@ decided to stop being maintained. Thanks. So this cog attempts to reproduce
|
|
201
|
171
|
that, logging as many meaningful events as possible.
|
|
202
|
172
|
|
|
203
|
173
|
Subcommands
|
|
204
|
|
-- `enable`/`disable` - You get the full firehose or you get nothing.
|
|
|
174
|
+- `/enable` or `/disable logging` - You get the full firehose or you get nothing.
|
|
205
|
175
|
|
|
206
|
176
|
### Patterns
|
|
207
|
177
|
|
|
|
@@ -210,10 +180,10 @@ criteria and take a number of automatic actions on them. The full syntax is kind
|
|
210
|
180
|
of complex and is detailed in its [own document](patterns.md).
|
|
211
|
181
|
|
|
212
|
182
|
Subcommands
|
|
213
|
|
-- `add ...` - Adds a new pattern to look for (see [Patterns](patterns.md)).
|
|
214
|
|
-- `remove <name>` - Removes a previously added pattern by name.
|
|
215
|
|
-- `list` - Show all configured patterns.
|
|
216
|
|
-- `setpriority <name> <priority>` - Alters the priority of a pattern. The
|
|
|
183
|
+- `/pattern add ...` - Adds a new pattern to look for (see [Patterns](patterns.md)).
|
|
|
184
|
+- `/pattern remove <name>` - Removes a previously added pattern by name.
|
|
|
185
|
+- `/pattern list` - Show all configured patterns.
|
|
|
186
|
+- `/pattern setpriority <name> <priority>` - Alters the priority of a pattern. The
|
|
217
|
187
|
priority is a unitless value used to pick which pattern wins if a message
|
|
218
|
188
|
matches more than one. Patterns without priorities set have a default value
|
|
219
|
189
|
of 100. The highest value wins.
|
|
|
@@ -241,17 +211,17 @@ things that are URL-like, like `[goodsite.com](https://badsite.com)` (without
|
|
241
|
211
|
the `https://`). Our deceptive link detection catches these URL-like link labels.
|
|
242
|
212
|
|
|
243
|
213
|
Subcommands
|
|
244
|
|
-- `enable`/`disable` - Toggle the feature.
|
|
245
|
|
-- `getjoinage`/`setjoinage` - Sets the length of time after joining when posted
|
|
|
214
|
+- `/enable` or `/disable urlspam` - Toggle the feature.
|
|
|
215
|
+- `/get` or `/set urlspam_joinage` - Sets the length of time after joining when posted
|
|
246
|
216
|
links are considered suspicious, in seconds.
|
|
247
|
|
-- `getaction`/`setaction` - Action to take when a join age link is detected.
|
|
|
217
|
+- `/get` or `/set urlspam_action` - Action to take when a join age link is detected.
|
|
248
|
218
|
One of these values:
|
|
249
|
219
|
- `nothing` - Ignore
|
|
250
|
220
|
- `modwarn` - Post a warning message in the log channel and tag mods.
|
|
251
|
221
|
- `delete` - Delete the message.
|
|
252
|
222
|
- `kick` - Kick the user.
|
|
253
|
223
|
- `ban` - Ban the user.
|
|
254
|
|
-- `getdeceptiveaction`/`setdeceptiveaction` - Action to take when a deceptive
|
|
|
224
|
+- `/get` or `/set urlspam_deceptiveaction` - Action to take when a deceptive
|
|
255
|
225
|
link is detected. One of these values:
|
|
256
|
226
|
- `nothing` - Ignore
|
|
257
|
227
|
- `modwarn` - Post a warning message in the log channel and tag mods.
|
|
|
@@ -272,7 +242,7 @@ warning message will be posted in the log channel. The pattern is just a simple
|
|
272
|
242
|
substring matched case-insensitively.
|
|
273
|
243
|
|
|
274
|
244
|
Subcommands
|
|
275
|
|
-- `enable`/`disable` - Toggle the feature.
|
|
276
|
|
-- `add <pattern>` - Adds a substring to look for in usernames of newly joined members.
|
|
277
|
|
-- `remove <pattern>` - Removes a pattern.
|
|
278
|
|
-- `list` - Lists all tracked patterns.
|
|
|
245
|
+- `/enable` or `/disable username` - Toggle the feature.
|
|
|
246
|
+- `/username add <pattern>` - Adds a substring to look for in usernames of newly joined members.
|
|
|
247
|
+- `/username remove <pattern>` - Removes a pattern.
|
|
|
248
|
+- `/username list` - Lists all tracked patterns.
|