Discord Bot

Overview

Saba-chan includes a built-in Discord bot (discord.js 14) that lets you control game servers directly from Discord chat.


Setup

1. Create a Discord Bot

  1. Go to the Discord Developer Portal and create a new application.
  2. Navigate to the Bot section and copy the bot token.

2. Register the Token

  • GUI: Settings → Discord Bot → enter token
  • CLI: :bot token <YOUR_TOKEN>

3. Invite the Bot

Generate an OAuth2 URL with message read/write permissions and invite the bot to your server.

4. Start the Bot

  • GUI: Click the bot icon in the title bar
  • CLI: :bot start
  • Auto-start: Set discordAutoStart: true in settings

Operating Modes

ModeDescriptionRequirement
LocalLogs into Discord directly, executes commands via local daemon IPCDefault mode
CloudCommunicates through relay server; no direct Discord login neededRELAY_URL + RELAY_NODE_TOKEN

Cloud mode enables the Discord bot even behind NAT without port forwarding.


Commands

Command format:

<prefix> <module> <command> [args...]

Default prefix: 사바쨩

Built-in Commands

CommandDescription
<prefix> or <prefix> helpShow help
<prefix> listList servers

Module Commands

CommandDescription
<prefix> <module> startStart server
<prefix> <module> stopStop server
<prefix> <module> statusCheck server status
<prefix> <module> <cmd> [args]Execute module command

Examples:

사바쨩 palworld status
사바쨩 minecraft start
사바쨩 zomboid stop

Alias System

Simplify commands with aliases in bot-config.json:

{
  "moduleAliases": {
    "팔": "palworld",
    "마크": "minecraft"
  },
  "commandAliases": {
    "켜": "start",
    "꺼": "stop"
  }
}

Result:

사바쨩 팔 켜    → 사바쨩 palworld start
사바쨩 마크 꺼  → 사바쨩 minecraft stop

Alias changes are hot-reloaded — no bot restart required.

Per-Guild Settings

Use nodeSettings in bot-config.json to filter instances by Discord guild.


Bot Extensions

ExtensionDescription
music.jsMusic playback (local mode only, requires yt-dlp + ffmpeg)
easter_eggs.jsEaster eggs
rps.jsRock-paper-scissors minigame