Message blacklist
Managing message blacklist is currently done via commands in Discord.
You can use them either by sending a DM to @PUBG bot#1548 or via a text channel it has access to (e.g. #moderators-only), but only if you have the proper roles (moderator and up).
All commands on this page need to be prefixed with !blacklist. For example the command list would need to be typed as !blacklist list.
Command parameters are specified as <required>, [optional] and (none).
- Command name:
add- Params:
<phrase> - Description:
- Adds a new blacklist phrase.
- Uses JavaScript’s
RegExpsyntax, with the flagsim. - If you are working on a “complex” regular expression, please test it a bit to make sure it’s not extremely taxing and might hang up the message.
- Example:
!blacklist add ^\d+$- matches a message where a line just includes numbers (\d= digits)
- Params:
- Command name:
disable- Params:
<phraseId> - Description:
- Disables a currently message blacklist phrase, specified by the message blacklist ID (number).
- Example:
!blacklist disable 3- Disables blacklist phrase with ID 3.
- Params:
- Command name:
edit- Params:
<phraseId> <newPhrase> - Description:
- Edits an existing blacklist phrase, specified by the message blacklist ID (number).
- Uses JavaScript’s
RegExpsyntax, with the flagsim.
- Example:
!blacklist edit 123 ^\w+$- Edits blacklist phrase with ID 123 to match a message where a line just includes word characters (\w= word characters).
- Params:
- Command name:
instantban- Params:
<phraseId> - Description:
- Toggles the “instant ban” feature for a message blacklist phrase, specified by the message blacklist ID (number).
- If the phrase is already set to be instant ban, it will revert back to “just delete” mode - and vice versa.
- Example:
!blacklist instantban 3- Toggles the “instant ban” feature for blacklist phrase with ID 3.
- Params:
- Command name:
list- Params:
(none) - Description:
- Lists all the currently enabled message blacklist phrases.
- The output format for the list is:
<ID> - [D(elete) or B(an)] - <phrase>
- Example:
!blacklist list
- Params:
- Command name:
ocr- Params:
<phraseId> - Description:
- Toggles the “OCR” feature for a message blacklist phrase, specified by the message blacklist ID (number).
- If the phrase is already set to be OCR, it will disable OCR checking for this phrase, similarly to
instantban. - When enabled, the bot will also check any text extracted from images in the message against the blacklist phrases. This is done using OCR (Optical Character Recognition) technology, which can recognize text within images.
- Example:
!blacklist ocr 3- Toggles the “OCR” feature for blacklist phrase with ID 3.
- Params:
- Command name:
reload- Params:
(none) - Description:
- Mainly for debugging. Only useful when I have manually updated the blacklist phrases by working directly in the database.
- Deletes all “cached” (in memory) blacklist phrases and reloads them from the database, including whether or not they’re enabled - or if instantban applies.
- Params:
- Command name:
test- Params:
<Your Message Text> - Description:
- Tests the message text to see if it matches an active blacklist phrase. Useful for making sure your blacklist phrase works as intended.
- Example:
!blacklist test 123566234- Check if there’s a matching phrase when the message text is just123566234(such as the example I used inadd).
- Params:
- Command name:
updateurlshorteners- Params:
(none) - Description:
- Forces an update of the URL shorteners listed here: https://github.com/PeterDaveHello/url-shorteners/blob/master/list
- Keep in mind that this triggers in the background every 24 hours, so it should never really be necessary to use this command.
- Forces an update of the URL shorteners listed here: https://github.com/PeterDaveHello/url-shorteners/blob/master/list
- Params:
OCR (Optical Character Recognition)
When the OCR feature is enabled for a blacklist phrase, the bot will also check any text extracted from images in the message against the blacklist phrases. This is done using OCR technology, which can recognize text within images. OCR isn’t perfect, so it might not always recognize the text correctly, but it can be a useful tool for catching messages that don’t otherwise have any text content that matches the blacklist phrases (looking at you crypto scammers).
To test OCR functionality, you can use the !ocr command and attach the images you want to test with the message. The bot will then give you the extracted text from the images and check if it matches any active blacklist phrases. This can help you ensure that your OCR-enabled blacklist phrases are working as intended.
!blacklist test has also been updated to include OCR checking, so you can test both regular message text and OCR-extracted text with the same command. Just make sure to attach the images you want to test with the message when using the test command.