A Discord bot that uses Tesseract to detect and block scam messages containing images with text.
  • TypeScript 97.2%
  • Dockerfile 2.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-03 15:22:15 -05:00
.github/workflows updated packages & build 2026-06-04 17:47:55 -05:00
src properly prestage worker & add more workers 2026-08-03 15:22:15 -05:00
.gitignore add russian support + update packages 2026-07-27 14:11:29 -05:00
Dockerfile add docker builds & readme 2026-01-14 08:57:21 -06:00
LICENSE.txt fix bad copy+paste 2026-06-28 15:36:16 +01:00
package.json add russian support + update packages 2026-07-27 14:11:29 -05:00
README.md fix typos and update message logs 2026-08-03 15:02:19 -05:00
tsconfig.json add russian support + update packages 2026-07-27 14:11:29 -05:00
yarn.lock add russian support + update packages 2026-07-27 14:11:29 -05:00

anti-scam-ocr

A Discord bot that uses Tesseract to detect and block scam messages containing images with text.

Using Docker Compose

Create a docker-compose.yml file with the following content:

version: "3.8"

services:
  anti-scam-ocr:
    image: ghcr.io/saeraphinx/anti-scam-ocr:latest
    container_name: anti-scam-ocr
    restart: unless-stopped
    volumes:
      - ./config:/app/config
    environment:
      - DISCORD_TOKEN: "your-discord-bot-token"
      - ALLOWED_CHANNELS: "1234,5678"
      - DISALLOWED_CHANNELS: "1234,5678"
      - IS_WHITELIST: "true"
      - LOG_CHANNEL: "optional-log-channel-id"
      - SHOULD_DELETE: "true"
      - SHOULD_TIMEOUT: "true"
      - SHOULD_KICK: "false"
      - TIMEOUT_DURATION: "7d"
      - SCAN_EVERYTHING: "true"
      - TRIGGERS_BEFORE_ACTION: "1"

Environment Variables

Example .env file

# Discord bot token
DISCORD_TOKEN=""
# comma separated list of allowed channel IDs
ALLOWED_CHANNELS=""
# comma separated list of disallowed channel IDs
DISALLOWED_CHANNELS=""
# whether to use the allowed channels or disallowed channels variable
IS_WHITELIST="true"
# channel ID for logging detected messages
LOG_CHANNEL=""
# whether to delete messages containing banned words
SHOULD_DELETE="true"
# whether to kick users for sending banned words
SHOULD_KICK="false"
# whether to timeout users for sending banned words 
SHOULD_TIMEOUT="true"
# duration of timeout for users who send banned words (see ms library for format)
TIMEOUT_DURATION="7d"
# whether to scan messages from all users, including bots & users that the bot cannot moderate
SCAN_EVERYTHING="true"
# number of triggers before punishment action is taken (timeout/kick)
TRIGGERS_BEFORE_ACTION="1"