Telegram bot announcing Veydrift solar satellite production queues
  • JavaScript 98.8%
  • Dockerfile 1.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Claude a7dc88f112
All checks were successful
CI / check (push) Successful in 2m7s
CI: run on git.borodutch.com (Forgejo Actions)
Non-Pages workflows move to .forgejo/workflows; GitHub (a push mirror) keeps only Pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:43:16 -07:00
.forgejo/workflows CI: run on git.borodutch.com (Forgejo Actions) 2026-10-22 15:43:16 -07:00
.github CI: run on git.borodutch.com (Forgejo Actions) 2026-10-22 15:43:16 -07:00
src Use planet-specific projected satellite energy for alerts (#5) 2026-09-30 13:37:47 -07:00
test Use planet-specific projected satellite energy for alerts (#5) 2026-09-30 13:37:47 -07:00
.dockerignore fix: make container state directory writable 2026-09-11 10:00:08 -07:00
.env.example feat: enrich solar satellite alerts (#1) 2026-09-11 11:32:07 -07:00
.gitignore feat: add Veydrift solar satellite Telegram bot 2026-09-11 09:59:34 -07:00
.nvmrc Run on Node 22 (Node.js Oct 2026 security release) (#6) 2026-10-21 10:05:52 -07:00
Dockerfile fix: make container state directory writable 2026-09-11 10:00:08 -07:00
nixpacks.toml Pin nixpkgs to Hydra-built release-26.05 (nodejs 22.23.4 cached) (#7) 2026-10-21 20:44:35 -07:00
package-lock.json Run on Node 22 (Node.js Oct 2026 security release) (#6) 2026-10-21 10:05:52 -07:00
package.json Run on Node 22 (Node.js Oct 2026 security release) (#6) 2026-10-21 10:05:52 -07:00
README.md Use planet-specific projected satellite energy for alerts (#5) 2026-09-30 13:37:47 -07:00

Veydrift Solar Satellite Bot

A small grammY bot that watches the live Veydrift contract on Base mainnet and announces Solar Satellite queues only when the planet’s built + queued satellites project at least 50,000 energy.

Each one-line announcement names the player, planet coordinates, newly queued amount, total Solar Satellites built or queued, and projected satellite energy after the queues finish (not energy already being produced). Players without a display name use a shortened wallet address.

Run

Requires Node.js 20 or newer.

npm install
cp .env.example .env

Set TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID in your environment, then run:

set -a
. ./.env
set +a
npm start

TELEGRAM_CHAT_ID may be a numeric chat ID or a public channel username such as @veydrift. The bot must be an administrator to post in a channel.

How it works

The process polls confirmed Base blocks for Veydrift's indexed ShipQueued event filtered to ship ID 9 (SolarSatellite). For each match it reads the planet owner, built count, active queue, and queue backlog at the event block, resolves the owner's Veydrift player profile, then posts through grammY.

Projected energy uses the event-block built + active-queue + backlog satellite count, including the new queue exactly once, multiplied by that planet’s per-satellite energy. Inactive and non-satellite queues are excluded. Per-satellite energy is (temperature + 140) / 6, integer-truncated then clamped to 1–65; there is no count-only bypass. planet.temperature is passed directly as the maximum temperature by the canonical contract (no offset): verified against VeydriftGame.energyBalance and VeydriftFormulas.solarSatelliteEnergy. Suppressed events still advance the existing cursor/deduplication flow.

The first run starts at the current chain head, so deploying the bot does not replay historical queues. The next block cursor is stored atomically in .state/cursor.json; mount .state on persistent storage in production.

Defaults:

  • Base mainnet RPC: https://mainnet.base.org
  • Veydrift proxy: 0xf397910F005151b09644228573a4353818D3755d
  • confirmations: 2

All defaults can be overridden with the variables shown in .env.example.

Test

npm run check
npm test