Skip to main content

Bot Lifecycle

Start, stop, and restart the Discord bot from the control panel without restarting the container, the panel, or the database.

The Connection Page

Connection holds everything about the bot itself. It is under Settings in the desktop sidebar and is the first page opened by the phone's Settings tab.

Connection page with the bot Online, Restart and Stop buttons, the Bot token showing Saved with Replace token, and the invite link with copy and open buttons
The Connection page

Save or Replace the Bot Token

  1. Paste the token into Bot token, or select Replace token to enter a new one.
  2. Select Save token.

The panel encrypts the token, and no page or API ever shows it again. Saving a new token makes a running bot reconnect with it on its own, and Operators, Administrators, and the Owner can save one.

Start, Stop, and Restart

The lifecycle buttons sit in the Bot section of both the Connection and Overview pages. The Owner, Administrators, and Operators can use them, and Viewers don't see them.

Each button sets the desired state and increases the revision. The bot checks for changes every BOT_CONTROL_POLL_INTERVAL_MS, about once a second by default, and the panel refreshes the status a few seconds later.

Bot Statuses

StatusMeaningWhat to do
OnlineThe bot is connected to DiscordNothing
StartingThe bot is connecting, for up to 15 seconds, or the bot process hasn't picked up the request yetWait for Online or Stopped by an error
StoppedThe bot is set to stay stopped, or has never been startedSelect Start when you're ready
Stopped by an errorThe last connection attempt didn't succeedCheck the token on the Connection page, then select Restart
Not connectedNo Bot Token is savedSave a token on the Connection page
Not respondingThe bot is set to run, but its process hasn't sent a heartbeat for 90 secondsRead docker compose logs app for the reason

Below a failed status, the panel shows "Check the bot token on the Connection page, then restart the bot." A failed bot waits until the revision changes before it tries again, so it doesn't retry on its own.

info

The log doesn't record why a connection failed, but a Bot can't sign in alert from Notifications includes Discord's reason. A wrong token, a privileged intent that is off in the Developer Portal, and a connection that takes longer than 15 seconds all lead to Stopped by an error.

Automatic Reconnects

A running bot reconnects whenever the revision changes, so saved settings take effect on their own.

Each reconnect closes the Discord connection and opens a new one. The bot forgets the members and messages it had seen, so a few features miss the first change for anything it hasn't seen again, as noted on their pages.

What Runs While the Bot Is Stopped