Scam Blocker
Scam Blocker deletes messages that match configured scam text patterns or known blocked images. It checks new messages and edits, including supported image attachments and link previews.
Set up through the dashboard
Use /image-filter add if you don't own the dashboard
Server owners and administrators can manage images. The bot needs View Channel and Manage Messages where it scans and deletes messages, plus permission to send messages in any selected log channels.
Configure using YAML
Edit the existing ImageFilter section in config/modules/moderation.yml. Keep the other sections in that file. Do not rename the key to ScamBlocker, add a duplicate ImageFilter: key, or wrap it in Moderation:.
This example enables text and image matching at 95%, allows images up to 25 MB, and sends detection results to a staff log channel. Replace the example log channel ID and keep Discord IDs in quotation marks.
ImageFilter:
Enabled: true
MatchPercentage: 95
MaxImageSizeMB: 25
Patterns:
- 'CyberLeek will stream GTA VI for * in the voice channel'
BypassRoles: []
BypassPerms:
- ManageMessages
WhitelistChannels: []
WhitelistCategories: []
Action: Delete
LogsChannelID:
- "234567890123456789" # Staff log channel.
Log:
Components:
- Type: container
AccentColor: "#EF4444"
Components:
- Type: text_display
Content: |-
## Scam Blocker
**Member:** {memberMention}
**Channel:** {channelMention}
**Match type:** {matchType}
**Reason:** {reason}
**Action:** {action}
**Message ID:** {messageId}
- Type: separator
Divider: true
Spacing: small
- Type: text_display
Content: '-# {guildName} · {timestamp}'Add image references through the dashboard or /image-filter add. They are saved separately for each server in MongoDB, rather than as file paths or URLs in this YAML section.
Valid module YAML changes reload automatically during normal bot operation. Saved per-server settings take precedence over the local defaults. Use the dashboard or /image-filter configure when changing a server that already has its own moderation settings.
Settings reference
Enabled
Enables both text matching and image scanning. The default is false.
MatchPercentage
Minimum image similarity required to delete a message. Whole number from 1 to 100; default 95. Does not affect text matching.
MaxImageSizeMB
Maximum size of each uploaded reference or scanned image. Whole number from 1 to 50; default 25.
Patterns
Text rules checked against message content. Use [] to scan images only.
BypassRoles
Members with any listed role are exempt. Use [] for no role-based exceptions.
BypassPerms
Members with any listed Discord permission are exempt. The default includes ManageMessages. Use Discord permission identifiers without spaces.
WhitelistChannels
Channels excluded from scanning. Excluding a parent channel also excludes its threads.
WhitelistCategories
Categories excluded from scanning, including their channels and threads.
Action
Must be Delete. Scam Blocker does not warn, time out, kick or ban members.
LogsChannelID
Optional additional log channel IDs. Use [] to disable dedicated alerts. Shared automatic moderation logs still apply.
Log
The component message design used for Scam Blocker alerts in dedicated and shared log channels.
For ID lists, replace [] with values such as ["345678901234567890"]. An empty whitelist means no channels or categories are excluded by that setting. It does not disable other bypass rules.
Text patterns
Patterns are checked against new messages and edits. Matching ignores case and can find a phrase within a longer message; it does not require the whole message to be identical.
Literal text
claim your free example reward
Matches that phrase wherever it appears.
Wildcard
CyberLeek will stream GTA VI for * in the voice channel
* matches variable text between the fixed parts, such as plain or linked “everyone”.
Regular expression
regex:claim\s+your\s+free\s+example\s+reward
Uses a case-insensitive regular expression after the regex: prefix.
The CyberLeek rule is included in the default configuration. The other examples only demonstrate syntax; choose phrases that are appropriate for your server. Invalid regular expressions are rejected when saving. In YAML, single-quote regex strings so backslashes remain literal.
To use image scanning only, change the existing setting to Patterns: []. There is no separate text-rule enable switch: both text matching and image scanning use ImageFilter.Enabled and the same exceptions.
Manage blocked images
The dashboard gallery includes bundled starter images and your server's uploaded references. Removed starter images remain visible with a restore control. Removed custom images can be uploaded again.
Upload up to 10 images at a time through the dashboard.
Store up to 500 custom reference images per server, in addition to the starter images.
Supported formats are JPEG, PNG, WebP, GIF and AVIF, up to 20 megapixels, within the configured size limit.
Animated images use the first frame only. Videos are not scanned as image references.
References, preview thumbnails and starter-image selections persist across bot restarts.
Images shown in this gallery are known scam references. Do not follow links or visit websites pictured in them.
Choose a match threshold
Start with the default 95%. A lower percentage accepts more visual differences, which can catch modified images but can also match unrelated content. A higher percentage requires a closer visual match.
The score measures similarity to a reference image. It is not a confidence score that an arbitrary image is a scam, and a 100% setting is not a byte-for-byte file comparison. Crops, overlays and other substantial changes can prevent a match.
Review the match percentage and threshold in detection logs when adjusting the setting. Increasing the maximum file size only allows larger files to be scanned; it does not change matching sensitivity.
Discord commands
The server owner or an administrator can use these commands:
/image-filter add
Attach a reference using the required image option. Optionally give it a short name.
/image-filter list
Show settings and active image IDs. Use the optional page option for more results.
/image-filter remove id:IMAGE_ID
Remove a custom image or disable a starter image. Replace IMAGE_ID with an ID from the list.
/image-filter configure enabled:true percentage:95 max-size-mb:25
Enable Scam Blocker and set image similarity and size limits for this server.
/image-filter configure enabled:false
Disable both text and image matching for this server.
The dashboard and commands use the same image collection. Text patterns, exceptions and log designs are managed in the dashboard or YAML. If the command is unavailable, check that image-filter is enabled in the bot's command settings.
Logging and message design
Under Moderation → Scam Blocker → Logging, choose optional Log channels. Alerts include the member, source channel, message ID, match details and deletion outcome.
The shared Automatic action notices log channels also receive these alerts. A channel present in both lists receives one copy. Leaving Scam Blocker's log list empty does not disable shared logs.
Use Scam Blocker log design to edit text, colours, layout and images, then Save changes. The same design is used for dedicated and shared Scam Blocker alerts. Other automatic moderation messages keep their own designs.
{memberId}, {memberMention}, {memberName}, {memberAvatarURL}
Details of the member whose message matched.
{channelId}, {channelMention}, {channelName}
Source channel details.
{guildId}, {guildName}
Server details.
{messageId}
ID of the matched message.
{reason}
Detection reason, including image match details when relevant.
{action}
Actual outcome, such as Delete or a message explaining a deletion failure.
{matchType}
Text or Image.
{pattern}
Matching text rule, or Not applicable for an image match.
{imageId}
Matching reference image ID, or Not applicable for a text match.
{matchPercentage}
Image similarity without a % sign, or Not applicable for a text match.
{threshold}
Configured minimum image match percentage, without a % sign.
{timestamp}
Detection time as a formatted Discord timestamp.
Mentions in these logs do not ping members. The shared DM affected member setting does not send a DM for Scam Blocker deletions.
What gets scanned?
Scam Blocker checks message text, supported image attachments, Discord-hosted image links and image previews that Discord makes available. It also handles later message updates when a link preview arrives after the original message.
It does not inspect every linked website or scan historical messages in bulk when enabled. External preview images are retrieved through Discord's image proxy. If there is no accessible supported image, there is nothing to compare against the blocked references.
Images that are unavailable, oversized, unsupported or cannot be decoded are skipped. Other images in the same message can still be checked. If a text rule or an image matches, the bot attempts to delete the entire message.
Bot messages, webhooks and messages from the server owner are excluded. Bypass roles, bypass permissions and channel/category exceptions also apply. Staff with Manage Messages are exempt by default.
Troubleshooting
Last updated