Skip to content

Channel point rewards that add PixFray dollars (backend) - #43

Merged
Finesssee merged 1 commit into
mainfrom
feat/channel-points
Oct 20, 2026
Merged

Finesssee merged 1 commit into
mainfrom
feat/channel-points

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Streamers asked to use Twitch channel points instead of a separate PixFray currency. This adds rewards that grant PixFray dollars; the existing shop stays.

What changes

  • Two admin actions, createPointReward and deletePointReward, broadcaster or owner only. Each reward gets its own channel.channel_points_custom_reward_redemption.add subscription.
  • A redemption adds the reward's dollars to the saved fighter once (keyed by redemption id, so Twitch retries are safe), marks it FULFILLED, and the bot posts the new wallet.
  • A viewer with no saved fighter is refunded (CANCELED) and linked to the fighter page.
  • A separate points sign-in (/auth/login?channel=<login>&connect=points) asks for channel:manage:redemptions on top of the earlier scopes.
  • Non-Affiliate channels get a plain 403: "Twitch only gives channel points to Affiliates and Partners, and is neither yet."

Not in this PR

  • The mod page UI (PR 2). STREAMER_SETUP.md gets its section then, since nothing is visible to streamers yet.

Tests

  • tests/points.test.ts drives signed EventSub bodies through handleEventsub into a real room on node:sqlite, and the admin actions through the Worker with Twitch mocked. bun run check passes (421 tests).

Docs: CONTRACTS.md §2, §4, §8; DUELS.md dollars; AGENTS.md code index.

The broadcaster makes Twitch channel point rewards through two new admin
actions; each reward gets its own redemption subscription. A redemption adds
the reward's dollars to the viewer's saved fighter once (keyed by redemption
id), marks it FULFILLED, and the bot posts the new wallet. Viewers with no
saved fighter are refunded (CANCELED) and pointed at the fighter page.

A separate points sign-in asks for channel:manage:redemptions. The mod page
UI comes in a follow-up.
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: nesszer/pixfray/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b420db26-b26e-493b-a3a1-28f8f4ac66ec
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Finesssee
Finesssee merged commit 1952072 into main Oct 20, 2026
3 checks passed
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