Repository navigation
feat: bring gateway guilds, emojis, stickers and invites to discord.js parity - #98
Conversation
◈ PR LensPR Lens paused analysis for this repository — the fair-use limit was reached. It resumes automatically at 2026-09-25T18:00:00.000Z. |
There was a problem hiding this comment.
ℹ️ No critical issues — minor suggestions inline.
Reviewed changes
- New discord.js-parity structures for guild assets:
AnonymousGuild,BaseInvite/GuildInvite/GroupDMInvite,Emoji/GuildEmoji,Sticker/StickerPack,GuildPreview,InviteGuild. - New managers
GuildEmojiManager,GuildEmojiRoleManager,GuildStickerManager,GuildInviteManager, plusGuildManageradditions (emojis()/stickers()/invites()accessors,create/edit/leave/delete/fetchPreview/fetchVoiceRegions/fetchVanityData/setIncidentActions). GatewayClientadditions:fetchInvite,fetchSticker,fetchStickerPacks,fetchVoiceRegions.- A new
MultiDispatchHandlersmechanism turningGUILD_EMOJIS_UPDATE/GUILD_STICKERS_UPDATEinto per-entity create/update/delete events via a cache-diff helper, plusINVITE_CREATE/INVITE_DELETEsingle-dispatch handlers. - Extensive new test coverage (
tests/guild-assets.test.ts, 485 lines) for derived fields, CRUD flows, and the multi-dispatch diff logic end-to-end.
ℹ️ Nitpicks
GuildManager.forget()(used byleave()/delete()) applies a syntheticGUILD_DELETEstraight to the cache, bypassingDispatchQueue's per-guild partition ordering. A realGUILD_DELETEarriving concurrently for the same guild could race with this out-of-band mutation. Low risk in practice — Discord will still deliver a genuineGUILD_DELETEafterwards that re-runs the same cascade through the properly-queued path — but flagging since every other cache mutation in this package goes through the queue. See inline comment.
Claude Sonnet | 𝕏
0f30ece to
6ca4de4
Compare
@wolfstar/plugin-api
@wolfstar/plugin-cache
@wolfstar/plugin-gateway
@wolfstar/plugin-i18next
@wolfstar/plugin-logger
@wolfstar/plugin-subcommands-advanced
commit: |
6ca4de4 to
4922950
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 →
|
…iscord.js parity Guild gains every field and discord.js's editing methods, and emojis, stickers, sticker packs and invites get their structures and guild managers. Emoji and sticker events are diffed against the cache, since Discord sends the whole list on every change. Refs #54
4922950 to
9307a42
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 #97.
🔗 Linked issue
Related to #54 (phase 6 of the roadmap).
🧭 Context
Guildonly had a dozen getters, and emojis, stickers and invites did not exist at all. A bot could not rename its guild, upload an emoji, or create an invite without raw REST calls. The emoji, sticker and invite events were missing too, soGUILD_EMOJIS_UPDATEonly showed up asraw.📚 Description
Guildnow has every field the API returns, and the editing methods discord.js has: theset*family,disableInvites,setIncidentActions,leaveanddelete. It also getsfetchOwner,fetchPreview,fetchVanityDataandfetchVoiceRegions.leaveanddeleterun the same cascade as aGUILD_DELETE, so no channel, member or role of the guild stays in the cache. Emojis, stickers and invites get their structures and guild managers, following discord.js's names. The client getsfetchInvite,fetchSticker,fetchStickerPacksandfetchVoiceRegions.The part I would look at first is the emoji and sticker events. Discord sends the whole list on every change, and discord.js diffs it against its cache. The dispatch table so far allowed one event per dispatch, so it gains a small
MultiDispatchHandlerstable whose handlers return a list of events. Two consequences worth knowing:raw. Emitting every emoji as "created" on each update seemed worse than nothing.listCached(), which enumerates the entity cache's keys. On Redis that reads the whole emoji or sticker index for one guild. It's fine at bot scale, but a per-guild index would be the fix if it ever shows up in profiles.Invites come in two shapes: REST has nested
channelandguild,INVITE_CREATEhas flatchannel_idandguild_id. The invite structures accept both, and the cache stores the REST ones with the flat IDs added, soinviteDeletefinds them either way.Left out on purpose:
Guild#fetchWebhooks(webhooks come with the channel phase), the welcome screen, widget, onboarding, templates, integrations, audit logs, bans list and scheduled events (moderation and admin phase), and discord.js'safkChannel/systemChannel... getters, since the IDs are there and the channel lookup is async.Key changes
Guildedit/set*,disableInvites,setIncidentActions,leave,delete,fetchOwner/Preview/VanityData/VoiceRegions,equalsAnonymousGuild,InviteGuild,GuildPreviewEmoji,GuildEmoji,GuildEmojiManager,GuildEmojiRoleManagerSticker,StickerPack,GuildStickerManager(multipart upload)BaseInvite,GuildInvite,GroupDMInvite,createInvite,GuildInviteManageremojiCreate/Update/Delete,stickerCreate/Update/Delete,inviteCreate,inviteDeleteType of Change
Pre-flight Checklist
pnpm changeset(orpnpm changeset add --emptyif no release is needed). See .changeset/README.md.