Skip to content

feat: /dj slash command for offsite jukebox (Spotify + djbox, real Tempo tips)#43

Open
max-digi wants to merge 4 commits into
mainfrom
dj/offsite-slash-command
Open

feat: /dj slash command for offsite jukebox (Spotify + djbox, real Tempo tips)#43
max-digi wants to merge 4 commits into
mainfrom
dj/offsite-slash-command

Conversation

@max-digi
Copy link
Copy Markdown

@max-digi max-digi commented May 25, 2026

Adds a /dj Slack command so anyone in a tipbot channel can drive the djbox jukebox with real Tempo tips. Built for the offsite — pairs with tempoxyz/djbox#28.

djbox-only by design. Spotify was considered but dropped: Spotify's Web API has no remove-from-queue endpoint, so an upcoming-track veto wouldn't have worked there. djbox owns the playlist, so one queue, one rule-set, one tippable surface.

UX

Command Action
/dj queue <youtube url> $DJ_QUEUE_PRICE_USD tip → adds to djbox
/dj queue <spotify url> Spotify URL is resolved to a YouTube query → djbox
/dj queue <free text> Search via djbox → top result queued
/dj skip $DJ_SKIP_PRICE_USD tip → feeds the skip-bid pot; cleared pot skips current
/dj veto <position> $DJ_VETO_PRICE_USD tip → feeds per-track veto pot; cleared pot removes upcoming track
/dj list Now-playing + next 10 upcoming with live veto pots
/dj nowplaying Shows current track from djbox
/dj where Posts the djbox party URL
/dj help Commands + live prices

Every action settles via Tip.handleTipRequest to DJ_HOUSE_PROVIDER_USER_ID before the queue/skip/veto fires. The public Slack reply includes the tx hash.

New files

  • src/lib/djbox.ts — djbox client (search, enqueue, skip-bid, veto, get-state) + YouTube/Spotify URL parsing + YouTube/Spotify oEmbed metadata helpers

New env

DJBOX_URL, DJBOX_PARTY_ID, DJBOX_SECRET
DJ_HOUSE_PROVIDER_USER_ID
DJ_QUEUE_PRICE_USD=0.005
DJ_SKIP_PRICE_USD=0.0002
DJ_VETO_PRICE_USD=0.005   # defaults to queue price

Slack manifest now registers /dj (and /djpr<N> for PR previews) alongside /tip.

Note

Could not run vp check / vp test in my local shell (node binary path mismatch with vp's runtime manager). tsgo -b type-check passes. Please run vp check + vp test here before merge — happy to fix any formatter nits in a follow-up.

Max Di Giacinto and others added 4 commits May 25, 2026 21:21
Adds a /dj Slack command that lets anyone in a tipbot channel queue
or skip music with real Tempo tips. Pairs with tempoxyz/djbox PR #28.

Subcommands:
- queue <spotify/youtube url or search>  ($0.005, default)
- skip                                    ($0.0002)
- nowplaying, where, help

Routing:
- Spotify URL or free-text  -> Spotify Web API (add-to-queue on the
  venue laptop's active device)
- YouTube URL               -> djbox enqueue
- Skip                      -> Spotify skip if configured, otherwise
  djbox skip-bid pot

Every action settles a real on-chain tip to DJ_HOUSE_PROVIDER_USER_ID
via Tip.handleTipRequest before queueing/skipping. Tx hash is included
in the public Slack reply.

New env:
- DJBOX_URL, DJBOX_PARTY_ID, DJBOX_SECRET
- DJ_HOUSE_PROVIDER_USER_ID, DJ_QUEUE_PRICE_USD, DJ_SKIP_PRICE_USD
- SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET, SPOTIFY_REFRESH_TOKEN

New scripts:
- pnpm spotify:setup  one-time localhost OAuth helper to mint the
  Spotify refresh token

Slack manifest now registers /dj alongside /tip.

Amp-Thread-ID: https://ampcode.com/threads/T-019e4c08-478b-730e-9eea-fe7310856ca4
Co-authored-by: Amp <amp@ampcode.com>
Goes djbox-only for the offsite. Spotify had no remove-from-queue API,
so an upcoming-track veto wouldn't have worked there. djbox owns the
playlist, so vetoing upcoming tracks (and seeing the queue) all works.

- Remove Spotify Web API client + OAuth setup script + env vars
- Drop Spotify path from /dj queue and /dj skip
- /dj list  -> shows now-playing + next 10 upcoming with veto pots
- /dj veto <position>  -> tip ($DJ_VETO_PRICE_USD, defaults to queue price)
  feeds a per-track veto pot; cleared pot removes the track from queue
- /dj nowplaying now reads from djbox (no Spotify required)
- Real Tempo tip still settles before every queue/skip/veto

Requires tempoxyz/djbox#28 with the new /state and /veto endpoints.

Amp-Thread-ID: https://ampcode.com/threads/T-019e4c08-478b-730e-9eea-fe7310856ca4
Co-authored-by: Amp <amp@ampcode.com>
Original event payload had stale author_association; force a fresh
synchronize event so the gate evaluates against current state.

Amp-Thread-ID: https://ampcode.com/threads/T-019e4c08-478b-730e-9eea-fe7310856ca4
Co-authored-by: Amp <amp@ampcode.com>
@max-digi max-digi requested a review from tmm May 27, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant