Self-Hosting
ScamShield is open-source and can be self-hosted. This guide covers setting up your own instance.Requirements
- Python 3.10+
- Discord Bot Token
- Discord OAuth2 Application (for dashboard)
- (Optional) Tesseract OCR for image text extraction
Repository
Configuration
1. Create a Discord Application
- Go to the Discord Developer Portal
- Create a new application
- Go to the Bot section and create a bot
- Enable Message Content Intent under Privileged Gateway Intents
- Copy the bot token
- Go to OAuth2 and copy the Client ID and Client Secret
- Add a redirect URL:
http://localhost:9000/callback
2. Set Up Environment Variables
Copy the.env.example to .env and fill in your values:
| Variable | Description |
|---|---|
BOT_TOKEN | Discord bot token |
DISCORD_CLIENT_ID | OAuth2 client ID |
DISCORD_CLIENT_SECRET | OAuth2 client secret |
SESSION_SECRET | Random string for session encryption |
IPC_SECRET | Shared secret for bot-dashboard IPC |
DEV_IDS | Comma-separated Discord user IDs for developer commands |
3. Install Dependencies
4. Run the Bot
5. Run the Dashboard (Optional)
Image Analysis Requirements
For casino scam image analysis, Pillow is required:/check):
Developer Commands
Developer-only commands (/dev status, /dev sync, /dev reload, etc.) are restricted to:
- The bot owner (user who created the application)
- Users listed in the
DEV_IDSenvironment variable
Database
The bot uses SQLite via SQLAlchemy. The database file is created automatically atdata/uas.db. No external database setup is required.
