Skip to content

Discord Connector

dcluomax edited this page Jun 1, 2026 · 1 revision

Discord Connector

Bridge your farm to a Discord server: one text channel per chicken, with a bot that listens for !coop … commands and submits jobs to the daemon. It runs only when explicitly enabled.

Configure from the Farm UI (recommended)

Click ⚙️ in the header and fill in the bot token, guild ID, and command prefix. Changes apply live — the bot hot-restarts with no daemon downtime, and credentials persist to ~/.coop/discord.json (mode 0600).

Configure via env vars (headless deploys)

export COOP_DISCORD_TOKEN=…           # https://discord.com/developers/applications
export COOP_DISCORD_GUILD_ID=…        # right-click your server → "Copy Server ID"
export COOP_DISCORD_PREFIX="!coop"    # default
export COOP_DISCORD_ALLOWED_USERS="123,456"   # default-deny: only these IDs can dispatch

The connector default-denies: only user IDs listed in COOP_DISCORD_ALLOWED_USERS (or the allowed_user_ids JSON field) can dispatch jobs.

Usage

Create a Discord channel named exactly like a chicken (aria, …), then in that channel:

Message Effect
!coop <prompt> submit a job to the chicken
!coop status show the chicken's current state
!coop hatch hatch a DEFINED chicken
!coop sleep / wake put the chicken to sleep / wake it
!coop help command list

Connector code lives in crates/coopd-discord; built on serenity 0.12.

Clone this wiki locally