Discord Setup β
Connecting spore.host to Discord posts instance lifecycle notifications β TTL warnings, idle stops, spot interruptions, completion β to a channel of your choice, as color-coded embeds.
Status: Phase 1 ships notifications (this guide). Discord slash commands (
/spore list|status|extend|stop) are Phase 2 β see spore-host/spawn#2.
What you'll get β
Channel notifications for lifecycle events, as Discord embeds color-coded by severity:
- β±οΈ rstudio terminates in 5 minutes (yellow)
- β bert-finetune has completed (green)
- π€ analysis has hibernated β idle timeout reached (red)
- β οΈ training received a Spot interruption notice (yellow)
Each embed carries the instance ID, region, and URL.
Step 1: Create a Discord channel webhook β
The simplest delivery path β no bot user required for notifications.
- In Discord, open the target channel's Edit Channel β Integrations β Webhooks.
- New Webhook, name it
spore-bot, pick the channel, Copy Webhook URL (looks likehttps://discord.com/api/webhooks/<id>/<token>).
Step 2 (optional, for Phase 2): Create a Discord application β
Only needed later for slash commands; skip if you just want notifications.
- Go to discord.com/developers/applications β New Application, name it
spore-bot. - On the General Information page, copy the Public Key (hex) β this is what verifies inbound interactions (Discord has no signing secret).
- Under Bot, add a bot and copy its token if you want bot DMs later.
Step 3: Register the workspace with spawn β
Store the webhook (and, optionally, the application public key for Phase 2) so the spore-bot service can deliver to your channel. Your Discord server (guild) ID is the workspace ID β enable Developer Mode in Discord, right-click the server, Copy Server ID.
spawn notify workspace-add \
--platform discord \
--workspace-id <GUILD_ID> \
--workspace-name "My Server" \
--webhook-url "https://discord.com/api/webhooks/<id>/<token>" \
--public-key <APPLICATION_PUBLIC_KEY> # optional; for Phase 2 slash commands--public-key is required only when you intend to use slash commands; for notifications alone, just the --webhook-url is needed. (Discord uses the public key for Ed25519 interaction verification, not a signing secret β so --signing-secret does not apply to --platform discord.)
Step 4: Launch with Discord notifications β
Tell the instance to route lifecycle notifications to Discord:
spawn launch rstudio --instance-type r7i.xlarge \
--slack-workspace <GUILD_ID> \
--notify-platform discord(--slack-workspace is the workspace-id flag β it carries the Discord guild ID here; the flag name is shared across platforms.) The instance is tagged spawn:notify-platform=discord and spawn:slack-workspace-id=<GUILD_ID>, and spored sends its lifecycle events to the spore-bot /notify endpoint, which posts the embed to your channel webhook.
That's it β you'll see embeds in the channel as the instance warns, stops, or completes.
Phase 2: Slash commands (/spore in your own server) β
Add the spore-bot application to your guild so members can run /spore list|status|start|stop|hibernate|url|extend|connect β your instances, your server. This is separate from the community spore.host server; you install the app wherever you want to control spores.
1. Configure the application β
In your Discord application (from Step 2 above):
- General Information β Interactions Endpoint URL: set it to the spore-bot service URL with a
/discordsuffix, e.g.https://<spore-bot-function-url>/discord. Discord sends a signed PING; spore-bot answers the PONG, so save succeeds only once the endpoint is live and your application Public Key is registered (Step 3 below). - Installation / OAuth2: add an install link with the
applications.commands(andbot, if you want notifications via the bot) scopes, then add the app to your server.
2. Register the slash command (one-time) β
DISCORD_APP_ID=<application-id> DISCORD_BOT_TOKEN=<bot-token> \
./scripts/register-discord-commands.sh
# fast testing in a single guild (instant vs ~1h global propagation):
DISCORD_APP_ID=β¦ DISCORD_BOT_TOKEN=β¦ DISCORD_TEST_GUILD_ID=<guild> \
./scripts/register-discord-commands.sh3. Register your guild + its public key β
So spore-bot can verify your guild's interactions and map commands to your instances:
spawn notify workspace-add --platform discord \
--workspace-id <YOUR_GUILD_ID> \
--public-key <APPLICATION_PUBLIC_KEY>
spawn notify register --platform discord \
--workspace-id <YOUR_GUILD_ID> --user-id <YOUR_DISCORD_USER_ID> \
--instance i-0abcβ¦ --nickname rstudio --allow status,stop,extendNow /spore status rstudio in your server returns your instance's state, TTL, and URL; /spore extend rstudio 4h extends its deadline β all verified against your application's Ed25519 key. The bot replies "thinkingβ¦" and edits in the result (Discord's 3-second deadline is met by a deferred response).