---
title: "Deploy Shugo"
description: "Context-aware Discord auto-moderation bot powered by Jev"
category: "Bots"
url: https://railway.com/deploy/shugo
---

# Deploy Shugo

Context-aware Discord auto-moderation bot powered by Jev

**[Deploy Shugo on Railway](https://railway.com/template/shugo)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/shugo/manifest.json

- **Creator:** glazk0's Projects
- **Category:** Bots

## Template content

### bot

- **Image:** ghcr.io/glazk0/shugo

## Documentation

# Deploy and Host Shugo on Railway

Shugo is a context-aware Discord auto-moderation bot powered by Jev, TypeSafe's System One model. It reads every message in your server, weighs it against the author's account age, how long they've been a member and their recent messages, then flags, deletes or times out rule breakers. Every action it takes is reported to a log channel.

## About Hosting Shugo

Shugo is a single Go binary shipped as a small distroless Docker image. It keeps an outbound gateway connection to Discord and calls the Jev API over HTTPS. It has no web server, no public port and no database: recent messages are kept in memory for a few minutes. Hosting it means running one always-on container with two secrets, a Discord bot token and a TypeSafe API key. Run exactly one replica, because each replica keeps its own history and would moderate every message again. Start with `DRY_RUN=true` and a log channel, tune the thresholds on real traffic, then turn enforcement on.

## Common Use Cases

- Stop spam bots and raids that join and post links within minutes
- Catch compromised accounts that suddenly blast scams across channels
- Remove harassment, hate and sexual content around the clock without a human on call
- Give a small moderation team a reviewable log of every borderline message
- Try AI moderation safely in dry-run mode before it touches anything

## Dependencies for Shugo Hosting

- A Discord bot from the [Discord Developer Portal](https://discord.com/developers/applications), with the **Message Content** privileged intent enabled
- A [TypeSafe](https://docs.typesafe.ai) API key for Jev, or an OpenRouter key through OpenRouter's Decisions API

### Implementation Details

Invite the bot with the `bot` scope and these permissions:

- **View Channels**, **Manage Messages** and **Moderate Members** in every channel you want moderated
- **Send Messages** and **Embed Links** in the log channel

Then move Shugo's role above the roles of the members it should moderate. Discord rejects timeouts on members whose highest role is at or above the bot's. Members with *Administrator* or *Manage Messages* are never moderated.

A deterministic policy turns Jev's probabilities into actions. The first matching row wins:

| Condition | Action |
|---|---|
| risk ≥ `DELETE_RISK` and (severity ≥ `TIMEOUT_SEVERITY` or suspicious author) | delete + timeout |
| risk ≥ `DELETE_RISK` | delete |
| risk ≥ `FLAG_RISK` and suspicious author | delete |
| risk ≥ `FLAG_RISK` | flag (report only) |

## Why Deploy Shugo on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Shugo on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

## Similar templates

- [Swarm](https://railway.com/deploy/swarm) — Named LLM bots join channels, take jobs, run routines on your Railway box
- [Telegram JavaScript Bot](https://railway.com/deploy/5lRkWa) — A template for Telegram bot in JavaScript using grammY
- [Cobalt Tools [Updated Sep ’26]](https://railway.com/deploy/cobalt) — Cobalt Tools [Sep ’26] (Media Downloader, Converter & Automation) Self Host

Open this page in a browser: https://railway.com/deploy/shugo
