Discord Bot & Cloud Relay
Saba-chan Discord bot configuration and the cloud relay pairing flow that lets you control your server without port forwarding.
Discord Bot & Cloud Relay
The Saba-chan Discord bot is an official bot operated on the cloud relay server. You don't need to run a bot process or manage a Discord token yourself. Invite the official bot to your Discord server, then pair it once with a code from the Saba-chan app.
1. How It Works
- 1Saba-chan daemonDiscord relay
Wait for new commands (long poll)
- 2DiscordDiscord relay
Send a command /saba … or chat
- 3Discord relaySaba-chan daemon
Hand over the command
- 4Saba-chan daemon
Check permissions
- 5Saba-chan daemonGame server
Start · console command
- 6Saba-chan daemonDiscord relay
Send the result
- 7Discord relayDiscord
Reply with the result
- The bot itself runs inside the relay server. Nothing bot-related is installed on your PC.
- Game servers run on your PC. The Saba-chan daemon on your PC connects out to the relay server with long-polling, fetches commands, and sends the results back.
- The daemon sends game commands in the order stdin (server console) → REST → RCON. Palworld uses its REST API. RCON is used only for a game that supports nothing but RCON, over loopback (127.0.0.1) only.
- Daemon ↔ relay traffic is outbound HTTPS from your PC only. No router port forwarding is required.
- Singing Saba-chan is handled on the relay side without going through your PC, so it works even when your PC is off.
2. Pairing
Pairing registers a host (the Saba-chan daemon) and nodes (Discord servers) on the relay server. It finishes with a single code entry.
2.1 Flow Diagram
- 1GUI appSaba-chan daemon
Ask for a pairing code
- 2Saba-chan daemonDiscord relay
Request a code
- 3Discord relaySaba-chan daemon
Code + poll secret (valid 5 min)
- 4Saba-chan daemonGUI app
Show the code
- 5DiscordDiscord relay
/saba connect code:…
- 6Discord relay
Register the PC · issue a node token
- 7GUI appSaba-chan daemon
Check status every 3 s
- 8Saba-chan daemonDiscord relay
Check status (with poll secret)
- 9Discord relaySaba-chan daemon
Connected + node token (once)
- 10Saba-chan daemon
Save the token · start the relay link
- 11Saba-chan daemonGUI app
Show “connected”
- The pairing code is 32 characters, and
pollSecretis 48 characters. The code is valid for 5 minutes. - The token is returned exactly once (atomic swap). The daemon, not the GUI, saves it to
.node_tokenas soon as it arrives and starts the relay connection. The app passes the poll secret only to the daemon on your PC, and the daemon sends it to the relay in a header, never in the URL. - Even if someone sees your pairing code, they cannot intercept the token without the
pollSecret. - You can connect several PCs to one Discord account. Connecting from an account that already has a PC shows
Connect as new PCandReconnectbuttons for your earlier PCs. Reconnecting a PC makes its old token stop working. One Discord server can also have PCs from several people (Discord).
2.2 App-side Steps
- In the Saba-chan app, open Discord → Connection and click Connect a Discord server.
- If the official Saba-chan bot isn't in your Discord server yet, invite it first with Invite the bot.
- The screen shows a connection code and the command to type. Click Copy and enter it in a Discord channel as
/saba connect code:<code>(the app may show the Korean name/사바쨩 연결 코드:<code>; it is the same command). - Only members with the Manage Server permission in that Discord server can run this command. If you send it in a DM with the bot, it connects just the PC to your account, without a Discord server.
- If this is your first time with this Discord account, the bot guides you through registration first. With
Register, you read the terms on the website and register, and then that reply turns into a connection confirmation. No PC is connected before you agree. - When the bot shows a button asking whether to connect, press
Connect. If you enter a code someone else gave you, that person's PC gets connected to your account, so press it only when the code came directly from your own Saba-chan app. - The app checks the status every 3 seconds through the daemon and switches to "Connected" once the daemon has saved
.node_token.
Once paired, the daemon keeps a long-poll connection to the relay server automatically. If you turn off the Command relay switch in the app, your PC stops receiving Discord commands and the bot won't answer.
2.3 Connecting another Discord server without a code
If your Discord account is already paired, you can run just /saba connect (no code) in another Discord server.
- The bot connects every PC linked to your account to that Discord server right away. You don't have to accept on the PC or pick a PC.
- If this is your first time with this account, you register first. Once you register, that Discord server is also registered with Saba-chan, and if no PC is connected it stays as a server without a PC (§2.5). If you are registered but have no PC, you are told to connect with a pairing code.
- A Discord server connected this way shows no game servers at first. In the Saba-chan app on your PC, pick which servers to use for that Discord server.
- A Discord server connected with a pairing code follows the Open my servers right away in new Discord servers setting on the app's Discord connection screen. When it is on, all servers show up right away; when it is off, you pick them yourself.
- As with a code, you need the Manage Server permission. If another PC is already connected to the Discord server, yours is attached alongside it rather than taking it over.
2.4 Unpairing
- Click Disconnect in the app → the daemon stops the command relay and deletes
.node_token. This PC is disconnected from every Discord server. - To detach just one Discord server, run
/saba disconnectin that server. Only the person who connected it or the Discord server owner can use it, and the server's channel assignments are removed as well.
2.5 Discord servers without a PC
People who haven't installed the Saba-chan app can also invite the bot and use Singing Saba-chan, Talking Saba-chan, Reading Saba-chan, server management commands, and game stats.
- Settings are stored on the relay. The Discord server owner or someone with the Manage Server permission changes the language, Talking Saba-chan and Singing Saba-chan channel assignments, emoji upscale, Talking Saba-chan settings, and Reading Saba-chan settings. You do this with the Discord
/sabacommands or in Saba-chan web, and you register the first time you change something. - There are no Saba-chan levels (the permission ladder) and no game server commands. Alert, Game chat, and Status board channels are sent by a PC, so they can't be assigned.
- If you connect a PC later, it takes over the settings as they are, and from then on that PC is the source of the settings.
- Ordinary member use, such as listening to music or chatting, does not require registration.
3. Bot Slash Commands
These are the commands under the official bot's root command. In Discord clients set to a language other than Korean, the root appears as /saba with English subcommand names (for example /saba connect); in Korean it is /사바쨩. On a Discord server with no PC connected, only connect, assign, language, settings, reading, web, big-emoji, and help appear, and instead of the "node owner", the Discord server owner or someone with the Manage Server permission uses them. The other slash commands (/tts, /stats, /clear, and so on) are in Commands.
| Command | Who | Action |
|---|---|---|
/saba status | Anyone | Show the status of the PC connected to this server and each game server (CPU, RAM) |
/saba connect [code] | Manage Server permission | Connect with a pairing code. Leave the code empty to connect every PC on your account to this server (§2.3). Registration first if it is your first time |
/saba disconnect | Connector or server owner | Disconnect this server from its PC |
/saba permission <level> [user] | Node owner | If you pick a user, give that member a command level (remove in the level list deletes their own level and returns them to the default level); if you leave it empty, set the default level for members without their own level (User at first). The level list is this server's permission ladder |
| Right-click a member → Apps → Change Saba-chan level | Node owner | Pick that member's command level from a list (remove is there too). The same as /saba permission. The menu is shown only to people with the Manage Server permission |
/saba sleep | Node owner | Put the bot to sleep on this server (ignores all messages) |
/saba wake | Node owner | Wake the bot up |
/saba assign kind:<Talking Saba-chan|Singing Saba-chan|Alerts|Game chat|Status board> | Node owner, server owner | Assign this channel as a Talking Saba-chan channel (several, up to 20; Talking Saba-chan only talks there), a Singing Saba-chan channel (one; ordinary messages are deleted, so it asks for confirmation), the alert channel (one; server crash, update, backup and scheduled-restart notices, plus a Restart button on crash alerts), the game chat channel (one; relays chat from inside the game server), or the status board channel (one; one status card per running server). For details, see Channel features in Commands. A channel has only one kind; running the same kind again removes it. Also changeable in the app's Discord server → Server management tab → Saba-chan assignments |
/saba language <language> | Node owner | Language the bot replies in on this server (Auto = follow the linked app's language) |
/saba reading | Node owner | Change this server's Reading Saba-chan volume, speed, pitch, and name calling. Only you can see it |
/saba big-emoji state:<On|Off> | Node owner, server owner | Repost messages that contain only one custom emoji as a large picture (off by default) |
/saba web | Anyone (own account) | One-time link (5 minutes) to Saba-chan web. If you have a PC it covers that PC too; if not, only the Discord server settings you manage. Only you see it |
/saba settings | Node owner | Change this server's Talking Saba-chan settings (on/off, jumping in, memory, AI moderation, confirmation step before commands, tools by category, trigger words). Tools blocked under all allowed tools in the app can't be turned on. Only you can see it |
/saba help | Anyone | Show how to use Saba-chan and the command list (only you can see it) |
/mysaba web | Anyone (own account) | Same as /saba web. Also works in any server or DM |
/mysaba my-pcs | Anyone (own PCs) | List the PCs connected to your Discord account, rename or remove them (only you see it) |
/mysaba agent | Anyone (own account) | View and disconnect the AI agents (remote MCP) connected to your Discord account. If there are none, it shows the address to put into the agent. Also works in DMs, only you see it (Connecting AI Agents) |
/saba update | Person who connected the PC | Checks for Saba-chan updates on the PC connected to this server and applies them after you press the confirm button |
/mysaba is about your own account, so it does not appear in the server member list. If you install Saba-chan on your own Discord account with the Install on my account button the bot shows after you connect a PC, it appears in any server or DM, visible only to you. In a DM with the bot, you use /saba web, /saba my-pcs, and /saba agent without installing it.
On a Discord server with a PC connected, the source of the permission, sleep, language, Singing Saba-chan, and Reading Saba-chan settings is Saba-chan's settings on your PC, so these commands take effect while your PC is on (a server without a PC: §2.5). The same settings can be changed on the app's Discord server screen. Permissions are on the Level commands and Levels per member screens that open when you click a server in the Instances tab; Singing Saba-chan and Reading Saba-chan have their own tabs; and language, prefix, and slash command style are on the Bot settings tab. Putting every Discord server to sleep at once is done on Discord → the Connection screen.
3.1 Per-server slash commands and the actions menu
After pairing, the bot registers extra commands in each Discord server.
/<server name> command:<command> arg1:… arg2:…: one command per game server instance. Discord's command list shows only one line per server. Tap the command field and the commands you can use on that server (start, stop, status, actions, module commands) appear as a list, and typing narrows them by name. The argument fields show a choice list, yes/no, a number range, or an input hint to match the command you picked.- The list leaves out commands your level can't use and commands that don't fit the server's current state (start on a running server, stop on a stopped one), and the commands you used most recently on that server come first. The Saba-chan app judges again whether you can actually use it.
- Actions: actions the Saba-chan app opens to Discord (restart, backup and so on) are in the same command list. Actions that need confirmation under the confirm-before-commands setting (§5) show what will change, and the person who asked must press the run button. Saba-chan app updates are not in the task menu; use
/saba update. - Players: servers whose game supports checking who is connected get a
playerscommand in the list. It shows how many people are online and their names. - Restore backup: pick the backup to restore from a list (typing a name narrows it down). If the server is running, the bot asks first whether to stop it; pressing Stop and continue stops the server and then restores. Restoring is a dangerous action, so it asks for confirmation once more before running. Only the person who asked can press the buttons.
- Ready notice: when you start or restart a server with its
/<server name>slash command, the Restart button on a notice, or Talking Saba-chan, the same channel is told "It's all started" once the server accepts players. If it never comes up, you get a one-line reason. - Only instances allowed for that server appear (app's Discord server → Instances tab).
4. Chat Commands (prefix)
Once paired, you can drive servers from Discord text channels using prefix-based commands.
Saba-chan <server> <command> [args…]
The default prefix is Saba-chan. You can change or add prefixes per Discord server in the app under Discord servers → Bot settings tab → Command prefix.
<server> can be an instance name, a server's call word, or a module name or alias. Commands shared by every module:
| Command | Description |
|---|---|
start | Start the server. Example: Saba-chan minecraft start |
stop | Stop the server |
status | Query status |
The words that call a server and its commands are set on the app's server screen → Discord tab. See the Commands document for the full command list.
5. Permission levels
Levels are Owner (3) > Admin (2) > User (1) > Guest (0) > Banned (-1). Levels are cumulative, so a higher level can use every command a lower level can.
- The Owner is the person who connected the server (the node owner). They can use every command and cannot be demoted.
- Each command has a risk (Safe, Caution, Danger). With the default preset the required levels are Safe = Guest, Caution = User, Danger = Admin. In the app's Discord server → Instances tab, click a server and, on the Level commands ladder, pick a preset (Loose, Default, Strict) or move a command chip to another level. Member levels and the default level are set on Levels per member in the same place and apply to all servers of the Discord server together.
- Help and list are open to everyone who isn't banned. Banned members cannot use any bot feature, including Singing Saba-chan and Talking Saba-chan.
- Requests that go through Talking Saba-chan cannot exceed the Talking Saba-chan limit (Guest by default).
Confirm before commands: Whether to ask the requester with a confirmation button before running is set in the app's Discord server → Bot settings tab → Confirm before commands card (or saba-chan-cli bot confirm). For requests made directly to the bot (prefix or slash), only dangerous commands are asked at first, and Talking Saba-chan asks about every command at first; for both you choose among Every command, Caution and above, Dangerous commands only, and Don't ask. You can change the risk step used for confirmation per command in the chip edit window on the permission screen (the required level doesn't change). Management actions that Talking Saba-chan picks are always asked, whatever the setting. Only the person who asked can press the confirm button.
6. Singing Saba-chan
Music playback is handled by the official music server (music-server) running alongside the relay server.
- When you run a command like
Saba-chan play …, the bot hands it to the music server, which streams audio into the Discord voice channel. - You don't need to install ffmpeg/yt-dlp on your PC.
- Music commands work in any channel. If you set a Singing Saba-chan channel with
/saba assign kind:Singing Saba-chan, you can type commands without the prefix (or just a search term) there, and a player screen is shown. - Singing Saba-chan is on by default; turn it off in the app's Discord server → Singing Saba-chan tab. On servers where it is on, the
/musicslash command is available (Commands, Singing Saba-chan commands).
7. Talking Saba-chan (AI chat)
- Talking Saba-chan works only after you register an API key in the app and turn it on for each Discord server (on the Discord server screen's Talking Saba-chan tab or with
/saba settings; new servers start off). The key is known only to your PC and the relay, never shown in Discord. - The tools it may use (game server control, web search, LoL, TFT and PUBG stats, MapleStory characters, multi-game search, everyday info, image generation) are also turned on per Discord server. Tools blocked under all allowed tools in the app's common menu are not used in any server. If you don't turn on the game server tools, it doesn't operate servers.
- Talking Saba-chan only talks in channels assigned with
/saba assign kind:Talking Saba-chan. In other channels it does not answer even when called. - Talking Saba-chan can only use actions that a module or extension opens to it. Anything else is refused.
- Lookups run right away. Actions that change something are first turned into a plan and go through a confirmation button according to the confirmation step (§5, every command at first). Management-type actions always go through a confirmation button. Only the person who asked can press the confirm button.
- It never runs anything above the Talking Saba-chan limit (§5).
- With Talking Saba-chan on, a chat command the daemon doesn't recognize is turned into an exact command by Talking Saba-chan and tried once more.
- Ask Talking Saba-chan about logs and it reads the server's logs, including earlier runs. Ask for the log as a file and it attaches a
.logfile without passing it through the AI (up to 4 MiB, newest part kept, IPs, secrets and paths masked).
8. Security Model
- The daemon sends the node token from pairing (
sbn_{hostId}.{secret}) in theAuthorization: Bearerheader over HTTPS. The relay checks that token against its stored Argon2 hash. - The relay server never stores the token itself; it compares against an Argon2 hash.
- The daemon accepts no incoming connections. Game server passwords are not sent to the relay.
9. Troubleshooting
| Symptom | Cause / Resolution |
|---|---|
| Bot doesn't respond | Check the prefix (default Saba-chan) and that there is a space after it. The bot must be in the server, pairing must be complete, and Command relay must be on in the app. Also check that the bot wasn't put to sleep with /saba sleep |
Saba-chan … start → server not found | The first word is the server (instance name/alias or module name/alias) and the second is the command. If you run several servers of the same game, use the instance name or a server alias |
| Pairing code expired | The code is valid for 5 minutes and that time has passed. Get a new code in the app |
| The app keeps waiting | Check that the /saba connect slash command was actually run and that you have the Manage Server permission |
| Discord commands don't reach the PC | x |
For more detailed troubleshooting flows, see the Troubleshooting document.