Skip to content

feat: add gateway integrations, templates, welcome screens, widgets, and onboarding - #111

Merged
RedStar071 merged 2 commits into
feat/guild-eventsfrom
feat/guild-extras
Sep 25, 2026
Merged

RedStar071 merged 2 commits into
feat/guild-eventsfrom
feat/guild-extras

Conversation

@RedStar071

Copy link
Copy Markdown
Member

Stacked on #110.

🔗 Linked issue

Related to #54 (phase 11c of the roadmap).

🧭 Context

The cache already stored integrations from the INTEGRATION_* dispatches, but nothing read them. Templates, welcome screens, widgets and onboarding had no support at all: Discord doesn't send them over the gateway, so they only exist through REST.

📚 Description

These now follow discord.js:

  • Integrations. Integration and guild.integrations, a cached per-guild manager (fetchAll, delete). Discord has no route to fetch one integration, so fetch lists them all and rejects with a RangeError when the ID isn't there. Audit log pages now return Integrations instead of raw payloads. New events: integrationCreate, integrationUpdate, integrationDelete and guildIntegrationsUpdate.
  • Templates. GuildTemplate and client.templates (fetch, list, create, edit, sync, delete, createGuild), plus discord.js's client.fetchGuildTemplate(code), guild.fetchTemplates() and guild.createTemplate(). fetch takes a discord.new URL or a bare code.
  • Welcome screen. WelcomeScreen from guild.fetchWelcomeScreen() and guild.editWelcomeScreen(). Emojis can be given as a Unicode emoji, a custom emoji mention, or an object. enabled is read from the cached guild's features, and is null when the guild isn't cached.
  • Widget. client.fetchGuildWidget(guildId) returns a Widget with WidgetMembers and imageURL(style). guild.fetchWidgetSettings() reads the settings. guild.setWidgetSettings() updates them, and patches widgetEnabled and widgetChannelId on the structure and in the cache.
  • Onboarding. GuildOnboarding, with its prompts and prompt options, from guild.fetchOnboarding() and guild.editOnboarding(). Discord needs an ID on every prompt and option, so new ones get placeholder snowflakes, like discord.js does.

Only multi-process sharding is left on the roadmap after this.

Key changes

Area Change
Structures Integration, GuildTemplate, WelcomeScreen, Widget/WidgetMember, GuildOnboarding/Prompt/PromptOption; Guild accessors; ReactionEmoji.resolvePartial
Managers GuildIntegrationManager, GuildTemplateManager; GuildManager welcome screen, widget settings and onboarding methods; client.fetchGuildTemplate, client.fetchGuildWidget
Events integrationCreate/Update/Delete, guildIntegrationsUpdate

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Workflow / CI change

Pre-flight Checklist

  • I have read the Contributing Guidelines (if applicable)
  • My code follows the code style of this project
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly
  • I added a changeset with pnpm changeset (or pnpm changeset add --empty if no release is needed). See .changeset/README.md.

🤖 AI disclosure: Wolfstar Agent Kit modified this description. My AI open-source policy.

@coldtea-pr-lens

coldtea-pr-lens Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

◈ PR Lens

🟢 +4 new · 🟠 ~3 changed · 🔴 -0 removed · 3 flows · 18 files · commit 73e164e


Architecture

Architecture diagram for wolfstar-project/plugins at 73e164e

7 components touched across 6 lanes.

Play the interactive walkthrough


Inside the changed components — 2 views

Component view — Guild Integrations & Gateway Events

Integration manager, gateway dispatch listeners, cache hydration, and event emissions

Architecture view of Component view — Guild Integrations & Gateway Events in wolfstar-project/plugins

Component view — Guild Templates, Onboarding & Community Extras

Guild template management, onboarding with snowflake IDs, welcome screens, and widget configuration

Architecture view of Component view — Guild Templates, Onboarding & Community Extras in wolfstar-project/plugins

Data flow

Data flow diagram for wolfstar-project/plugins at 73e164e

Integration update dispatch and diff · Creating a guild from a template · Editing guild onboarding

Follow each request, response and payload


The other flows — 2 sequences

Creating a guild from a template

Sequence diagram of Creating a guild from a template in wolfstar-project/plugins

Editing guild onboarding

Sequence diagram of Editing guild onboarding in wolfstar-project/plugins

View

  • Architecture lens
  • Data flow lens
  • Expand every detail

Tip

Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."

🪧 More tips
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Untick Architecture lens or Data flow lens under View to hide a diagram, or tick Expand every detail to open every section. The comment redraws in a few seconds
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture and data flow row. Drawing still runs on every push
  • Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing every push. Comment @pr-lens draw on a pull request when you want that one drawn
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • Push a commit and the comment redraws for the new head. A slow older run never overwrites a newer one
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion

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

❤️ Share

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one minor nit inline.

Reviewed changes

Reviewed the full diff adding five new plugin-gateway surfaces (integrations, templates, welcome screens, widgets, onboarding) plus their tests.

  • Integrations — Integration structure, GuildIntegrationManager (guild.integrations, fetchAll, delete), and integrationCreate/Update/Delete + guildIntegrationsUpdate events. Audit log pages now return Integration[] instead of raw payloads.
  • Templates — GuildTemplate and a plain (uncached, since Discord never pushes them over the gateway) GuildTemplateManager with fetch/list/create/edit/sync/delete/createGuild.
  • Welcome screen — WelcomeScreen, guild.fetchWelcomeScreen()/editWelcomeScreen(); enabled is derived from the cached guild's features.
  • Widget — Widget/WidgetMember, client.fetchGuildWidget(), guild.fetchWidgetSettings()/setWidgetSettings() (patches the structure and the guild's cache entry).
  • Onboarding — GuildOnboarding/Prompt/PromptOption, with a placeholderId() snowflake generator for new prompts/options, matching discord.js's own workaround for Discord's ID requirement.
  • New ReactionEmoji.resolvePartial() helper, reused by welcome-screen channels and onboarding prompt options to build the emoji_id/emoji_name/emoji_animated triple.

I cross-checked every Routes.* builder and REST request/response body type used here (RESTPatchAPIGuildWidgetSettingsJSONBody, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPutAPIGuildOnboardingJSONBody, RESTAPIGuildOnboardingPrompt(Option), and the nested-vs-flat emoji shape on APIGuildOnboardingPromptOption) against [email protected] directly — all correct. The new dispatch before/build handlers for IntegrationUpdate/Delete correctly snapshot the cached entity before plugin-cache removes/overwrites it (verified against plugin-cache/src/lib/operations.ts's existing Integration* cache-write cases), matching the established pattern used by other *Delete handlers. Tests use exact assertions (route args, resolved emoji IDs/names, placeholder-ID regex, cache presence/absence) rather than loose checks, and would catch regressions in the emoji-resolution and placeholder-ID logic specifically.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using Claude Sonnet | 𝕏

@pkg-pr-new

pkg-pr-new Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@wolfstar/plugin-api

pnpm add https://pkg.pr.new/wolfstar-project/plugins/@wolfstar/plugin-api@111

@wolfstar/plugin-cache

pnpm add https://pkg.pr.new/wolfstar-project/plugins/@wolfstar/plugin-cache@111

@wolfstar/plugin-gateway

pnpm add https://pkg.pr.new/wolfstar-project/plugins/@wolfstar/plugin-gateway@111

@wolfstar/plugin-i18next

pnpm add https://pkg.pr.new/wolfstar-project/plugins/@wolfstar/plugin-i18next@111

@wolfstar/plugin-logger

pnpm add https://pkg.pr.new/wolfstar-project/plugins/@wolfstar/plugin-logger@111

@wolfstar/plugin-subcommands-advanced

pnpm add https://pkg.pr.new/wolfstar-project/plugins/@wolfstar/plugin-subcommands-advanced@111

commit: 73e164e

@pullfrog

pullfrog Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Your Claude subscription has hit its usage limit. It resets at 7:20pm (UTC). Re-trigger Pullfrog after the reset, or add an ANTHROPIC_API_KEY repo secret — Pullfrog routes around an exhausted subscription automatically when one is present.

Add repo secret → · Model settings → · Setup docs → · Ask in Discord →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using Claude Sonnet | 𝕏

@pullfrog

pullfrog Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Your Claude subscription has hit its usage limit. It resets at 7:20pm (UTC). Re-trigger Pullfrog after the reset, or add an ANTHROPIC_API_KEY repo secret — Pullfrog routes around an exhausted subscription automatically when one is present.

Add repo secret → · Model settings → · Setup docs → · Ask in Discord →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using Claude Sonnet | 𝕏

@pullfrog

pullfrog Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Warning

Your Claude subscription has hit its session limit, stopping every run until it resets.

Every Pullfrog run on wolfstar-project has failed since September 25 (5 runs, no successes), so this review did not happen.

Claude returns "You've hit your session limit · resets 7:20pm (UTC)". The repo is configured to use an Anthropic model and authenticates via your Claude Pro/Max subscription, which has a limit on how many concurrent sessions or hours it can serve — no fallback API key is stored, so runs fail until the limit window clears.

To fix it:

  1. Add an ANTHROPIC_API_KEY on the BYOK tab of your Billing card — any valid API key lets runs continue when the subscription limit is hit, and the setup docs cover where to create one.
  2. Check your Claude plan usage to see the current limit and when it next resets — the subscription remains the primary credential, and the API key serves only as a fallback when the plan caps.

@RedStar071
RedStar071 merged commit 2e8ff40 into main Sep 25, 2026
21 of 26 checks passed
@RedStar071
RedStar071 deleted the feat/guild-extras branch September 25, 2026 18:02
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