Skip to content

Bernard AutoMod

Overview

Bernard's AutoMod feature is an automated content moderation suite that identifies inappropriate user messages, deletes them, and applies punishment commensurate with the crime.

AutoMod consists of the following components:

  • Text Filters - Deletes messages that contain inappropriate content through simple or complex pattern-matching. Punishes the message author depending upon the severity of the violation and the author's past violations.
  • Video Analysis - Analyzes attachments, embeds, and Tenor GIFs in messages sent to the server for malicious content. Specifically, detects whether a video or GIF would crash Discord.
  • Gatekeeping - Limit users that are allowed to join the server based upon characteristics of their Discord account/profile.
  • Dynamic Slow Mode - A highly-configurable anti-spam measure designed to prevent malicious actors from spamming text or attachments in your server.

Text Filters

Filter Hierarchy

The Filters component of Bernard's AutoMod consists of a simple three-tier hierarchy:

  • Filter Categories (sometimes referred to as categories) group together a list of filters serving a common purpose.
  • Filters target a specific inappropriate word or phrase that is not allowed in the server. A filter groups together a list of regular expressions (simply referred to as regexes) that match against the inappropriate word or phrase.
  • Regular Expressions (simply referred to as regexes) are a popular way of identifying patterns within text. A regex can be as simple as matching a single word/phrase, or it can be exceptionally complex. If you are unfamiliar with regex, we highly recommend completing the interactive tutorials at RegexOne.

For example, the built-in profanity filter category groups together filters that identify racist and ableist slurs. Each filter consists of one or more regexes that match a particular slur and its variations.

A visualization of the relationship between filter categories, filters, and regular expressions is shown below.

AutoMod Filter Visualization

Filter Scores

When a user sends a message in your server, AutoMod will begin analyzing the contents of the message with filters. If a filter detects an inappropriate word or phrase in a message, the filter will assign a score to the message based upon the number of violations in the message. The total score of the message is the sum of all filter scores.

If the total score for a message is higher than 0, then the message will be deleted. The total score is multiplied by Score Multipliers and (if applicable) combined with the user's Score History to create a final score, which determines the punishment for the user based on Score Thresholds.

Score Multipliers

The final score of a message can be affected by two multipliers:

  • Member Age Multiplier - Increases final score of a message sent by accounts that are new to the server.
  • Account Age Multiplier - Increases final score of a message sent by accounts that are new to Discord (meaning, they were recently created).

The member age multipliers are shown in the table below.

Member Age Multiplier
<= 1 Hour 5x
<= 6 Hours 4x
<= 1 Day 3.5x
<= 3 Days 3x
<= 1 Week 2x
<= 2 Weeks 1.5x
<= 1 Month 1.15x
> 1 Month 1x

The account age multipliers are shown in the table below.

Account Age Multiplier
<= 1 Hour 10x
<= 1 Day 7.5x
<= 1 Week 5x
<= 1 Month 2.5x
<= 3 Months 1.5x
> 3 Months 1x

Note

The member age multipliers and account age multipliers cannot be modified at this time.

The final score of a message will be multiplied by the sum of both multipliers (assuming both multipliers return a value other than 1).

For example, if a message has a total score of 100, the account of the message's author was created 1 week ago, and the message's author joined the server 3 days ago, the multiplier for the total score will be 8x. Therefore, the final score will be 800.

These multipliers are designed such that new accounts and new members of the server are punished more harshly than established accounts or members. This is to combat sock puppet spam accounts whose purpose is to quickly join and spam servers with profanity or slurs.

Score History

By default, a filter that detects inappropriate content in a message will factor in the author's recent AutoMod violations within the past two weeks (14 days) when calculating the final score of the message. This time period is known as the Score History Period. This concept is best demonstrated through an example.

Consider a scenario where a user in a server sent a message to the server that violated AutoMod filters a week ago. This message had a score of 100. Today, the user sends another message to the server that violates AutoMod filters with a total score of 150. After Score Multipliers are applied to the total score of the message (for the sake of this example, assume the multiplier is 1x), the user's previous AutoMod violation score (100) will be added to the current message's total score. As a result, the final score of the current message will be 250.

Consider another scenario where a user in a server sent a message to the server that violated AutoMod filters 10 days ago. This message had a score of 100. A few days later, the user sent a message to the server that violated AutoMod filters with a score of 75. Today, the user sends another message to the server that violates AutoMod filters with a total score of 150. After Score Multipliers are applied to the total score of the message (for the sake of this example, assume the multiplier is 1x), the user's previous AutoMod violation scores (100 + 75 = 175) will be added to the current message's total score. As a result, the final score of the current message will be 325.

Note

At this time, there is no way to change the Score History Period - however, this feature is on the roadmap and will be configurable in a future release.

This concept is extremely important to understand when creating custom filters. Remember, by default, AutoMod filters will factor in a user's Score History when calculating the final score for a message. If you create a custom filter that is designed to prevent fairly harmless messages from being sent to the Discord server (such as invites to other Discord servers, a link to a specific news source, etc.), and that custom filter has a score of 1 (such that they should never be harshly punished for violating the custom filter), users can still be harshly punished if they violate the custom filter and have violated AutoMod filters in the past.

When creating a custom filter, you can use the !filter track-score-history command to modify this behavior. When Score History Tracking is disabled on an AutoMod filter, that AutoMod filter will not take recent AutoMod history into account when calculating the final score for an AutoMod violation.

Warning

If a message violates multiple AutoMod filters, and at least one of those AutoMod filters has Score History Tracking enabled, then recent AutoMod history will be taken into account when calculating the final score for the AutoMod violation. In other words, in order for recent AutoMod history to be ignored when calculating the final score for the AutoMod violation, all violated AutoMod filters must have Score History Tracking disabled.

Score Thresholds

Once the final score of a message is calculated, a punishment for the message's author can be determined. The table below shows the threshold for each punishment.

Punishment Score Threshold Description
Soft Warning <=80 Deletes the message and publicly warns the user, but does not record the violation on the user's rapsheet.
Hard Warning <=150 Deletes the message and publicly warns the user, recording the violation on the user's rapsheet.
Kick From Server <=200 Deletes the message and kicks the user from the server, recording the violation on the user's rapsheet. The user is able to re-join the server immediately afterwards.
1 Hour Ban <=300 Deletes the message and temporarily bans the user from the server for one hour, recording the violation on the user's rapsheet.
1 Day Ban <=500 Deletes the message and temporarily bans the user from the server for one day (24 hours), recording the violation on the user's rapsheet.
7 Day Ban <=800 Deletes the message and temporarily bans the user from the server for seven days, recording the violation on the user's rapsheet.
Permanent Ban <=1000 Deletes the message and permanently bans the user from the server, recording the violation on the user's rapsheet.

Note

These score thresholds cannot be modified at this time. If you would like to tune when Bernard punishes a user for violating a specific filter, we recommend modifying the score of the filter with the !filter score command.

Final Score Examples

The table below demonstrates a handful of examples regarding how the final score of AutoMod filter violations is calculated.

For clarity, the headings of this table are explained below:

  • Automod Filter Regular Expression - The regular expression configured for an AutoMod filter that is violated.
  • AutoMod Filter Score - The score of the filter configured via the !filter score command.
  • Message Contents - The contents of a message analyzed by the AutoMod filter.
  • Total Score - The score of the message after all AutoMod filters analyze the message.
  • Author Account Age - The amount of time it has been since the message author created their Discord account.
  • Author Member Age - The amount of time it has been since the message author joined the Discord server.
  • Score Multiplier - The total multiplier based on the message author's account and member age.
  • Score History Tracking - Whether Score History Tracking is enabled or disabled for the AutoMod filter.
  • Previous AutoMod Score - Recent AutoMod violation scores within the Score History Period.
  • Final Score - The final score of the AutoMod violation after the total score, multipliers, and previous AutoMod violations are factored in.
  • Punishment - The punishment that AutoMod will inflict on the message author.
AutoMod Filter Regular Expression AutoMod Filter Score Message Contents Total Score Author Account Age Author Member Age Score Multiplier Score History Tracking Previous AutoMod Score Final Score Punishment
apples | oranges | grapes 50 apples 50 1 year 6 months 1x Enabled 0 50 Soft Warning
apples | oranges | grapes 50 apples and oranges 100 1 year 6 months 1x Enabled 0 100 Hard Warning
apples | oranges | grapes 50 apples and oranges 100 1 year 6 months 1x Enabled 50 150 Hard Warning
apples | oranges | grapes 50 apples and oranges 100 2 months 3 weeks 2.65x Enabled 0 265 1 Hour Ban
apples | oranges | grapes 50 apples and oranges 100 2 months 3 weeks 2.65x Enabled 50 315 1 Day Ban

Default Filters

Bernard comes with a number of pre-loaded filters that detect common inappropriate words or phrases, which are documented in detail in the Default Filters page. Bernard's AutoMod is designed to work out-of-the-box and be as low-touch as possible - for that reason, most administrators should not need to modify any settings for default filters. As soon as Bernard joins the server, it will begin analyzing incoming messages for inappropriate words or phrases.

We perform extensive testing of default filters to ensure that common inappropriate words or phrases are reliably identified and that false positives are minimized. However, if your server encounters a false positive, we encourage you to report it to us through our support channel so that we can improve the reliability of default filters!

Custom Filters

Some administrators may want to detect and delete words or phrases not covered by Default Text Filters. For example, one might want to remove links to a specific news source or Reddit subreddit using Bernard's filters. With a Bernard Premium subscription, administrators can create their own custom filters to accomplish this task.

Filter Categories

Filter categories have a number of different characteristics described by the below subsections.

Name

The name of a filter category is a brief description of the filter category. This name can be seen in messages to the user if they violate the filter category, so it should not contain sensitive information.

Filters

Filters have a number of different characteristics described by the below subsections.

Name

The name of a filter is a slug that describes the word or phrase that the filter detects at a very high level. This name can be seen in messages to the user if they violate the filter, so it should not contain sensitive information.

Description

The description of a filter augments the name by adding additional details about the word or phrase that the filter detects. This is not included in messages sent to the user for AutoMod notifications, but can be viewed in the output of !filter list.

UUID

Each filter has a UUID (Universally Unique Identifier), which uniquely identifies the filter from other filters. This allows two filters to share the same name.

Status

A filter category can have one of three statuses:

  • Enforcing - Discord messages in the server are analyzed by filters within a filter category. If a message violates a filter, then the message is automatically deleted and the author of the message is punished. The exact punishment depends on the severity of the violation and is described in more detail in the "Filters" section of this document. Administrators become aware of the violation through a notification posted in the AutoMod notifications channel configured in the server.
  • Permissive - Discord messages in the server are analyzed by filters within a filter category. If a message violates a filter, the message is not automatically deleted and the author of the message is not punished. Administrators become aware of the violation through a notification posted in the AutoMod notifications channel configured in the server.
  • Disabled - Discord messages in the server are not analyzed by filters within this filter category. Violations are not punished.

Score

Each filter has a score, which is an integer representing each regular expression match that a Discord message has against this filter. This is a cumulative number that increments for each unique match within a Discord message.

For example, consider a filter with a score of 20 that matches against the word "okay". If somebody enters a message containing "okay okay okay", the score of the message against this filter would be 60 (20 * 3).

Score History Tracking

Indicates whether recent AutoMod violations are factored in when calculating the final score of a current AutoMod violation. For more details about this, please refer to the Score History section of this page.

Video Analysis

Bernard will automatically analyze video attachments, embeds, and Tenor GIFs (collectively referred to as a "video") for malicious content. Specifically, Bernard can detect whether a video has the potential to crash one's Discord client with extremely high accuracy and speed.

By default, Bernard will automatically delete a video that contains malicious content. This feature is enabled by default when Bernard joins a server - no specific configuration is needed for Bernard to take action on videos containing malicious content.

For more information about how to configure this feature, refer to the "Configure AutoMod Video Analysis" section of the Getting Started guide.

If you find a video that crashes Discord that Bernard did not detect and delete, please let us know! Join Bernard's Support Discord server and post the video in the "filter-submissions" channel.

Gatekeeping

Dynamic Slow Mode

The Dynamic Slow Mode feature of AutoMod is a Bernard Premium-only feature designed to detect and stop consistent spam within a server.

Getting Started

To get started with configuring the Dynamic Slow Mode feature, take the following steps:

  1. Ensure your server has Bernard Premium activated.
  2. Enable the Dynamic Slow Mode feature through the /configuration automod dynamic_slow_mode True slash command.
  3. Allow either all messages to be analyzed through the /configuration automod dynamic_slow_mode_messages True slash command, or ensure only messages with embeds or attachments to be analyzed through the /configuration automod dynamic_slow_mode_attachments slash command.
  4. If desired, ensure only new members of the server are subject to the Dynamic Slode Mode by configuring an age value through the /configuration automod dynamic_slow_mode_age slash command.
  5. If desired, modify components of the Dynamic Slow Mode algorithm as described in the Algorithm and Components section of this page.

Algorithm and Components

Dynamic Slow Mode leverages an algorithm to help detect spam. A server can configure most components of this algorithm to fine-tune spam detection. The algorithm consists of the following components:

  • Message Expiration Timer - The amount of time that must pass before Bernard "forgets" that a specific user recently sent messages in the server. This timer is reset to the value calculated by the algorithm if a user sends a message before this timer expires.
  • Recent Messages - The number of messages a user has sent before the Message Expiration Timer expires.
  • Base Interval - Affects the calculation of the Message Expiration Timer. Configurable through the /configuration automod dynamic_slow_mode_interval command. This has a default value of 2.5.
  • Exponential Factor - Affects the calculation of the Message Expiration Timer. Configurable through the /configuration automod dynamic_slow_mode_exponent command. This has a default value of 1.1.
  • Message Count Limit - The number of messages a user is allowed to send within the Configurable through the /configuration automod dynamic_slow_mode_limit command. This has a default value of 3.

The algorithm is as follows:

Message Expiration Timer = (Base Interval * Recent Messages) ^ Exponential Factor

Note

The Message Expiration Timer is rounded to the nearest whole number.

An example may help demonstrate how the Dynamic Slow Mode algorithm works. Assume that a server has the default algorithm component values configured:

  • Base Interval: 2.5
  • Exponential Factor: 1.1
  • Message Count Limit: 3

A user sends their first message into the server. The algorithm calculates a value of 3 seconds (shown below), then starts the Message Expiration Timer accordingly. The Recent Messages counter is set to 1 for this user.

(2.5 * 1) ^ 1.1 = 2.739895566 = 3 seconds (rounded to nearest whole number)

The user waits a full 3 seconds before doing anything else. Therefore, the Message Expiration Timer expired before the new message is sent. The Recent Messages counter is decremented from 1 to 0 as well.

Then, the user send another message into the server. For this new second message, the algorithm calculates a value of 3 seconds again and starts the Message Expiration Timer accordingly. The Recent Messages counter is set to 1 for this user.

The user then sends another message into the server 1 second later, which is before the running Message Expiration Timer has expired. The algorithm calculates a value of 6 seconds (shown below) and restarts the Message Expiration Timer with this new value. The Recent Messages counter is incremented from 1 to 2 for this user.

(2.5 * 2) ^ 1.1 = 5.873094715 = 6 seconds (rounded to nearest whole number)

2 seconds later, the user sends yet another message into the server. At this time, the Message Expiration Timer has not yet expired. For this new message, the algorithm calculates a value of 9 seconds (shown below).

(2.5 * 3) ^ 1.1 = 9.174182807 = 9 seconds (rounded to nearest whole number)

The Recent Messages counter is incremented from 2 to 3 for this user. The Recent Messages counter is now equal to the Message Count Limit configured in the server. Therefore, Bernard will delete all three messages the user recently sent into the server, then warn the user that they have sent too many messages into the server recently, and continuing to spam will result in punishment. The user is also told how long they need to wait before the Message Expiration Timer expires, thus allowing them to chat again.

If the user ignores this warning and sends another message, then:

  • The new message will be deleted
  • The user will be permanently banned. An entry is added to the user's rapsheet.
  • If an AutoMod OmniLogs channel is configured, a notification will be sent to the relevant channel.

Note

At this time, permanent bans are the only punishment supported by the Dynamic Slow Mode feature. In a future release of Bernard, this punishment will be configurable to include temporary bans, silencing the user, and kicking the user.

Other Configuration Options

In addition to being able to configure components of the Dynamic Slow Mode algorithm, you can also configure the following options:

  • Minimum Server Membership Age - Identifies the amount of time that a user has been a member of the server. When configured, the Dynamic Slow Mode feature will only target users who have been a member of the server for less than or equal to the configured age. This can be configured through the /configuration automod dynamic_slow_mode_age slash command.

Exemptions

The Dynamic Slow Mode feature will not execute against messages sent by users matching the following conditions:

  • The user is a bot account.
  • The user has a moderation-related administrative capability.