Repository navigation
feat: add gateway integrations, templates, welcome screens, widgets, and onboarding - #111
Conversation
◈ PR Lens
Architecture 7 components touched across 6 lanes. Play the interactive walkthrough Inside the changed components — 2 viewsComponent view — Guild Integrations & Gateway Events Integration manager, gateway dispatch listeners, cache hydration, and event emissions Component view — Guild Templates, Onboarding & Community Extras Guild template management, onboarding with snowflake IDs, welcome screens, and widget configuration Data flow
Follow each request, response and payload The other flows — 2 sequences
View
Tip Run 🪧 More tips
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. |
There was a problem hiding this comment.
ℹ️ 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 —
Integrationstructure,GuildIntegrationManager(guild.integrations,fetchAll,delete), andintegrationCreate/Update/Delete+guildIntegrationsUpdateevents. Audit log pages now returnIntegration[]instead of raw payloads. - Templates —
GuildTemplateand a plain (uncached, since Discord never pushes them over the gateway)GuildTemplateManagerwithfetch/list/create/edit/sync/delete/createGuild. - Welcome screen —
WelcomeScreen,guild.fetchWelcomeScreen()/editWelcomeScreen();enabledis derived from the cached guild'sfeatures. - Widget —
Widget/WidgetMember,client.fetchGuildWidget(),guild.fetchWidgetSettings()/setWidgetSettings()(patches the structure and the guild's cache entry). - Onboarding —
GuildOnboarding/Prompt/PromptOption, with aplaceholderId()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 theemoji_id/emoji_name/emoji_animatedtriple.
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.
Claude Sonnet | 𝕏
dcc7080 to
d9bc3c6
Compare
@wolfstar/plugin-api
@wolfstar/plugin-cache
@wolfstar/plugin-gateway
@wolfstar/plugin-i18next
@wolfstar/plugin-logger
@wolfstar/plugin-subcommands-advanced
commit: |
d9bc3c6 to
86afb31
Compare
|
Your Claude subscription has hit its usage limit. It resets at 7:20pm (UTC). Re-trigger Pullfrog after the reset, or add an Add repo secret → · Model settings → · Setup docs → · Ask in Discord →
|
86afb31 to
73e164e
Compare
|
Your Claude subscription has hit its usage limit. It resets at 7:20pm (UTC). Re-trigger Pullfrog after the reset, or add an Add repo secret → · Model settings → · Setup docs → · Ask in Discord →
|
|
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:
|

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:
Integrationandguild.integrations, a cached per-guild manager (fetchAll,delete). Discord has no route to fetch one integration, sofetchlists them all and rejects with aRangeErrorwhen the ID isn't there. Audit log pages now returnIntegrations instead of raw payloads. New events:integrationCreate,integrationUpdate,integrationDeleteandguildIntegrationsUpdate.GuildTemplateandclient.templates(fetch,list,create,edit,sync,delete,createGuild), plus discord.js'sclient.fetchGuildTemplate(code),guild.fetchTemplates()andguild.createTemplate().fetchtakes adiscord.newURL or a bare code.WelcomeScreenfromguild.fetchWelcomeScreen()andguild.editWelcomeScreen(). Emojis can be given as a Unicode emoji, a custom emoji mention, or an object.enabledis read from the cached guild's features, and isnullwhen the guild isn't cached.client.fetchGuildWidget(guildId)returns aWidgetwithWidgetMembers andimageURL(style).guild.fetchWidgetSettings()reads the settings.guild.setWidgetSettings()updates them, and patcheswidgetEnabledandwidgetChannelIdon the structure and in the cache.GuildOnboarding, with its prompts and prompt options, fromguild.fetchOnboarding()andguild.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
Integration,GuildTemplate,WelcomeScreen,Widget/WidgetMember,GuildOnboarding/Prompt/PromptOption;Guildaccessors;ReactionEmoji.resolvePartialGuildIntegrationManager,GuildTemplateManager;GuildManagerwelcome screen, widget settings and onboarding methods;client.fetchGuildTemplate,client.fetchGuildWidgetintegrationCreate/Update/Delete,guildIntegrationsUpdateType of Change
Pre-flight Checklist
pnpm changeset(orpnpm changeset add --emptyif no release is needed). See .changeset/README.md.