Commands

This wiki page contains a list of commands and their explanation.

Executing commands and giving feedback

SmokeDetector commands and feedback are provided to SmokeDetector as chat messages in one of the rooms in which SmokeDetector is listening for commands (see the list of chat rooms). Feedback can be given either as a reply to a post, or using the sd prefix in a message which is not a reply. Commands are in the format !!/<command text> or sdc <command text>, which are entered in new chat messages, not as replies.

In order to keep this list of commands more concise, SmokeDetector commands are listed here in their !!/<command text> form, but all of them are able to be used with the sdc <command text> syntax.

As an example, the following two commands are equivalent:

!!/alive
sdc alive

Silent mode

If you don’t want SmokeDetector to reply when executing a command, you can add a hyphen (-) at the end, like fp-. This is a good practice to cut down on chatroom clutter. Note that SmokeDetector will always report any errors, even if a trailing - is present. The hyphen can be placed after the command itself or after its parameters.

All commands support the silent mode, though it’s more commonly used when replying to spam reports, managing black- and white-list, and managing chat notifications.

Commands for everyone

These commands can be executed by everyone.

Commands as reply for everyone

Privileged commands

These commands require privileges. Note that some commands may be disabled in some rooms. You may talk to others to understand why.

Blacklists, watchlists, and the user-whitelist

These commands manages the detection blacklists and whitelists. Except for the user-blacklist and user-whitelist, all commands require “blacklist manager”

User-blacklist and user-whitelist

The user-blacklist and user-whitelist are maintained per SmokeDetector instance. The SmokeDetector instances do not share these lists between themselves. Thus, if the SmokeDetector instance is switched, the new instance will only have a record of the entries on these lists which were added/removed while that instance was active.

User-blacklist

The user-blacklist is a dynamic list of users which will have any post of theirs reported by SmokeDetector anytime one of their posts is scanned. Users are primarily added to the user-blacklist when someone gives tpu feedback to a post the user has authored, or when one of their posts is manually reported to SmokeDetector with !!/report and the post would not have otherwise been detected. Users are automatically removed from the user-blacklist when fp feedback is given for a post they have authored. Users can also be explicitly added, removed, or their blacklist status determined with the following commands:

Commands
Feedback

User-whitelist

The user-whitelist is a list of users for which posts will not be reported if the only detections of the post are on the user’s username. If there are other detections triggered, then the post will be reported with the username detections included. Users are added to the list if their post receives fpu feedback. Users can also be explicitly added, removed, or their whitelist status determined with the following commands:

Commands
Feedback

Detection blacklists and watchlists

For all !!/blacklist-* and !!/watch* commands:

All commands that add entries to one of these lists run the new entry through a variety of checks. If some checks are not passed, then a chat reply message is posted detailing what didn’t pass. All such commands have a -force variant (i.e. append -force to the command; e.g. !!/watch-force), which will bypass these checks, except checks for actual duplicate entries, which are considered a hard error. You should not be in the habit of directly running the -force variant of the commands. Run the non -force version first to see what SmokeDetector says. If you have verified that you still want to add the entry, despite the issues SmokeDetector mentioned, then you can edit your chat message to add -force, or post a new chat message with -force. Even very experienced users rarely go directly to using the -force version without running the command as a non- -force version first.

Non -number blacklists and watchlist

The non -number blacklists and watchlist are lists of regular expressions (regexes) which are used to test some or all of post bodies, post titles, and usernames for matching text. See the description of the command for adding entries to each list for a statement as to what the entries on that list are tested against.

Because these lists are regular expressions, make sure regex special characters are escaped (in particular, . characters should be escaped as \.) when not used for the special meaning. The regular expression variant that SmokeDetector uses is the regex package.

When adding to the blacklists, any entry in the watchlists which exactly matches what you’re adding to the blacklist will be automatically removed from the watchlists. In other words, adding to the blacklist is assumed to be moving an entry from the watchlist to the blacklists, if it already exists on a watchlist.

The regexes for the keyword-blacklist and watchlist have \b prepended and appended to them prior to testing against post bodies, titles, and usernames. For both of those lists, the i and s flags are set (case insensitive and . matches newline). The other lists do not bookend the regexes with \b and only have the case insensitive flag, i, set. Note: the actual bookending begins the overall regex with (?:^|\b|(?w:\b)) and ends it with (?:\b|(?w:\b)|$). The documentation for the regex package briefly describes what the w (word) flag in the bookending does.

Commands

-number blacklists and watchlist

The -number blacklist and watchlist are lists of numbers that are tested against post bodies, post titles, and usernames as text both verbatim and “normalized” (with everything but numbers removed). The numbers lists are not based on regular expressions, but do support regex-like comments in the form of (?#comment here). Comments are completely stripped from the entries prior to any checking. Number entries must have between 6 and 20 digits (inclusive).

North American Numbering Plan (NANP) numbers

Numbers which are, potentially, North American Numbering Plan (NANP) numbers will be tested both with and without the leading “1” country code. When adding a number, if Smoke Detector can’t determine that the number is very likely a NANP number or can’t be a NANP number, Smoke Detector will respond asking for clarification as to if the number is a NANP number or not, or for -force to be used to have Smoke Detector assume that it is a NANP number. For clarification to Smoke Detector:

How are number entries checked?

The number entries are checked for in the test text in three different ways:

  1. An exact match. In order for a “number” to make an exact match, the pattern must begin with a digit or up to two of +,(,[, or { immediately followed by a digit. When adding new entries, they will be checked to verify that an exact match can be made. However, while it’s preferred that entries be in a format compatible with making an exact match, it’s not necessary for that to be the case, so you can use -force to add an entry which won’t be able to make an exact match.
  2. Normalized. The entry itself is reduced to just ASCII numbers. The text being tested is reduced to just ASCII numbers with sequences between 6 and 20 digits (inclusive), where a “sequence” is all groups of ASCII-number characters separated by non-digit characters.
  3. Deobfuscated. The entry itself is reduced to just ASCII numbers. The characters in the text being tested first are translated from a substantial number of Unicode characters which are sometimes used to obfuscate the representation of numbers into ASCII numbers (i.e., number homoglyphs are converted to their equivalent ASCII-number characters) and then that text is reduced to just number sequences with between 6 and 20 digits (inclusive), where a “sequence” is all groups of ASCII-number characters separated by the remaining non-digit characters.
Commands

Commands applicable to both -number and non- -number blacklists and watchlists (excluding the user-blacklist and user-whitelist described above)

Since the !!/bisect command is computationally intensive, the test commands are preferred if you’re only interested in whether something would be caught. The bisect command should be reserved for when you need to know exactly which entry in the watch/blacklist would be responsible for the detection. The !!/bisect-number command is not computationally intensive, so there isn’t the same concern.

Additionally, for offline testing, you can clone this repository locally and run the command ./util.py bisect "<string>".

If your intention is merely to check whether something is already on a list with the intention of adding it if it is not, then just go ahead and issue the command to add it. SmokeDetector will automatically run the equivalent of the test command and reply to you with a warning if what you attempted to add would already be caught by an item on one of the lists. Otherwise, it will be added. In other words: don’t ask to add, just add.

Privileged commands as reply

These commands require privileges and have to be posted as a reply to a message of SmokeDetector.

User-friendly syntax:

Complete list:

Aliases

Some frequently used commands have one-letter aliases or convenient words that can be used instead:

Command Alias of
f fp-
notspam fp-
k tpu-
spam tpu-
rude tpu-
abuse tpu-
abusive tpu-
offensive tpu-
r/a tpu-
v tp-
vand tp-
vandalism tp-
n naa-

A note on message deletion

Messages by SmokeDetector can be deleted within 2 minutes after they were posted by using the del, remove, or gone commands. After 2 minutes are up, SmokeDetector cannot delete its own messages in response to those commands, so any deletion after that window must be done by a moderator.

Messages will also be deleted in Tavern on the Meta and SO Close Vote Reviewers, or Raiders of the Lost Downboat if the relevant post is deleted or marked as false positive before the 2-minute window is up.

Please note that the usage of deletion commands is discouraged in Charcoal HQ. Generally, messages in CHQ are kept as a record of all reported posts for multiple reasons:

The delete-force command can be used if a report really needs to be deleted in Charcoal HQ.

Shortcut commands

You can now use a shortcut to post a reply to one, two or three messages at the same time, in this shape:

sd cmd1
sd cmd1 cmd2
sd cmd1 cmd2 cmd3
sd cmd1 cmd2 cmd3 cmd4
sd cmd1 cmd2 cmd3 cmd4 cmd5

cmd1 will be invoked in the most recent message, cmd2 on the message before that and cmd3 on the message before that, and so on.

It’s also possible to skip a message. Replace a command with a - to skip a message. For example, sd - delete skips the most recent message and deletes the message before that one.

Smokey will reply to your shortcut command unless all commands have quiet mode (like tp-) or just don’t reply by default (like delete).

A few examples:

You can also put a digit in front of a command so that the command will apply as many times as the digit. A few examples: