Discord Bot

Contracts & Missions

Contracts are the heart of the system: community-created objectives that pay out in-game and are verified against real telemetry from the player's vessel.

The contract lifecycle

  1. 1

    Created

    A contract is authored and stored in Firestore via the contract CRUD layer in data/contracts.py.

  2. 2

    Accepted

    A member accepts it in Discord. If their KSP client is linked, the mod makes it visible in the custom Mod UI.

  3. 3

    Submitted

    When the player believes they have met the objective, the mod sends current vessel telemetry to the API for verification.

  4. 4

    Verified & paid

    The server checks the submission against the contract’s requirements and, if satisfied, credits the reward.

Telemetry-backed verification

On the game side, the mod’s collector reads live values from the active vessel, including situation, celestial body, resources, crew and more, and submits them. The server compares these against the contract definition, so completions reflect what actually happened in the game.

Example submission payload
{
  "contract_id": "land-on-mun-01",
  "vessel": {
    "situation": "LANDED",
    "body": "Mun",
    "crew": 1,
    "resources": { "LiquidFuel": 120.4 }
  }
}

Weekly missions

Each week the bot generates a fresh set of community missions. They are classified into build-a-craft versus active-vessel objectives, and the classification is cached in Firestore so the work is done at most once per week.

Cached classification

Mission text is generated and classified once, then reused all week from the mission_classifications collection, keeping AI calls and latency low.