Repository navigation
feat: add gateway scheduled events, stage instances, and soundboard sounds - #110
Conversation
◈ PR Lens
Architecture 7 components touched across 4 lanes. Play the interactive walkthrough Inside the changed components — 2 viewsComponent view — Scheduled events and stages Managers, structures, and cache operations for scheduled guild events and stage instances. Component view — Soundboard sounds Managers, structures, and voice channel integration for guild and default soundboard sounds. Data flow
Follow each request, response and payload The other flows — 1 sequence
View
Tip The CLI's 🪧 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 new issues found.
Reviewed changes
Reviewed the full diff (21 files, 1 commit) adding scheduled events, stage instances, and soundboard sounds to @wolfstar/plugin-gateway, following the repo's established per-guild CachedManager pattern.
GuildScheduledEvent/GuildScheduledEventManager(guild.scheduledEvents) —fetchAll,create,edit,delete,fetchSubscribers, discord.js-style setters, status checks,url,coverImageURL.StageInstance/StageInstanceManager(guild.stageInstances, keyed by stage channel ID) —StageChannel#createStageInstance/#fetchStageInstance, the latter returningnullon Discord's 404 for a non-live stage.SoundboardSound/GuildSoundboardSoundManager(guild.soundboardSounds) —fetchAll,create,edit,delete;client.fetchDefaultSoundboardSounds();VoiceChannel#sendSoundboardSound; default (guildless) sounds reject edit/delete.- Dispatch/event wiring — create/update/delete handlers for all three in
util/dispatch.ts, plusguildScheduledEventUserAdd/Remove,guildSoundboardSoundsUpdate,soundboardSounds, with correspondingGatewayEventMapentries and README docs. plugin-cachefix —GUILD_SCHEDULED_EVENT_CREATE/UPDATEnow also upserts the event'screatorinto theusersstore, so the new subscription-event handlers can resolve the user from cache.
I cross-checked every REST route, REST body type, and gateway dispatch payload type used in this PR directly against the vendored [email protected] source rather than trusting the diff at face value:
- Delete dispatches for scheduled events and stage instances carry the full object (
GatewayGuildScheduledEventDeleteDispatchData/GatewayStageInstanceDeleteDispatchData=APIGuildScheduledEvent/APIStageInstance), so hydrating straight fromdatawithout abeforesnapshot is correct.GUILD_SOUNDBOARD_SOUND_DELETE's dispatch data is ID-only ({sound_id, guild_id}), and that handler correctly uses abeforecache read + emitsprevious ?? null— matching the "snapshot before cache write" pattern the rest of the dispatch table already uses for removal events. GuildSoundboardSoundCreate/Update's dispatch data types are untyped aliases ofAPISoundboardSound(guild_idis optional in the type, even though guild-scoped dispatches always carry it) — thedata.guild_id!assertions indispatch.tsare factually justified, not a hallucinated guarantee.- All new
Routes.*calls (guildScheduledEvent*,stageInstance*,*soundboardSound*,sendSoundboardSound,soundboardDefaultSounds) and REST body shapes (RESTPost/PatchAPIGuildScheduledEventJSONBody, soundboard/stage equivalents) match the real route builders and field names. edit()/delete()on the three new structures follow the codebase-wide convention (this[kPatch](x.toJSON())/return this;) exactly.tests/guild-events.test.tsasserts exact converted REST bodies, exact emitted event args, and the 404→nullfallback — meaningful coverage, not tautological.
No correctness issues found.
Claude Sonnet | 𝕏
@wolfstar/plugin-api
@wolfstar/plugin-cache
@wolfstar/plugin-gateway
@wolfstar/plugin-i18next
@wolfstar/plugin-logger
@wolfstar/plugin-subcommands-advanced
commit: |
7d97ed1 to
ff00f4a
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 →
|
ff00f4a to
ff21ace
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 →
|

Stacked on #109.
🔗 Linked issue
Related to #54 (phase 11b of the roadmap).
🧭 Context
The cache already stored scheduled events, stage instances and soundboard sounds, but nothing read them: no structures, no managers, and their dispatches only reached
raw.📚 Description
They now follow discord.js, on the same per-guild manager pattern as bans and rules:
GuildScheduledEventandguild.scheduledEventswithfetchAll,create,edit,deleteandfetchSubscribers. The event has discord.js's setters (setName,setStatus,setLocation, the schedule times, ...), the status checks,urlandcoverImageURL. Subscribers come with their user and, withwithMember, their member, and both are cached.StageInstanceandguild.stageInstances, keyed by stage channel like the cache.StageChannel#createStageInstanceand#fetchStageInstancereturnnullwhen the stage isn't live, since Discord answers 404.SoundboardSoundandguild.soundboardSounds(fetchAll,create,edit,delete).client.fetchDefaultSoundboardSounds()lists Discord's own sounds, andVoiceChannel#sendSoundboardSoundplays one. Default sounds have no guild, so editing or deleting them rejects.guildScheduledEventUserAdd/Remove,guildSoundboardSoundsUpdateandsoundboardSounds.One plugin-cache fix:
GUILD_SCHEDULED_EVENT_CREATE/UPDATEnow upserts the event's creator intousers, like discord.js does. Without it, the subscription events couldn't resolve their user from the cache.Left for phase 11c: templates, welcome screen, widget, onboarding and integrations, then multi-process sharding.
Key changes
GuildScheduledEvent,StageInstance,SoundboardSound;StageChannelandVoiceChannelmethods;GuildaccessorsGuildScheduledEventManager,StageInstanceManager,GuildSoundboardSoundManager,client.fetchDefaultSoundboardSounds@wolfstar/plugin-cacheusersType of Change
Pre-flight Checklist
pnpm changeset(orpnpm changeset add --emptyif no release is needed). See .changeset/README.md.