Discord Bots

Build your own bot

Economics and War does not run community Discord bots — it exposes everything a bot needs so you can run your own. Host it anywhere; the game is unaffected if your bot goes offline.

Command → endpoint map
/nationGET /api/v1/nations?search= or /nations/{id}
/allianceGET /api/v1/alliances/{id} and /alliances/{id}/members
/warGET /api/v1/wars/{id} and /wars/{id}/battles
/warsGET /api/v1/wars?status=active&nation_id=
/marketGET /api/v1/market
/priceGET /api/v1/market
/rankingsGET /api/v1/rankings?board=nations|alliances
/conflictGET /api/v1/global-conflicts
/eraGET /api/v1/eras
/nukesGET /api/v1/events?type=strategic_weapon.launched
/historyGET /api/v1/events and /api/v1/news
Nation verification
  1. A player opens Settings → Developer API and generates a verification code.
  2. The code is 10 characters, cryptographically random, single-use, and expires in 10 minutes.
  3. The player runs your bot's /verify CODE command in Discord.
  4. Your bot redeems it server-side.
GET /api/v1/discord/verify/AB12CD34EF

{
  "data": {
    "verified": true,
    "nation": { "id": "...", "nation_name": "...", "leader_name": "...", "national_score": 812 },
    "alliance": { "alliance_id": "...", "rank": "officer", "alliances": { "name": "...", "tag": "..." } }
  }
}

Economics and War supplies the verified identity — nation ID, nation name, alliance and alliance rank. Your bot decides which Discord roles to assign. Discord passwords are never requested or stored, and codes cannot be redeemed twice.

Bot etiquette
  • Cache public data such as rankings and nation profiles for at least 60 seconds.
  • Honour x-ratelimit-remaining; back off on 429 rather than hammering.
  • Use one key per bot so a leak can be revoked without downing your whole toolkit.
  • Prefer webhooks over polling for war and alliance events.