Conversation
Reorganize MessageType constants and add many new message type values using iota offsets. Notable additions: ContextMenuCommand, AutoModerationAction, RoleSubscriptionPurchase, InteractionPremiumUpsell, StageStart/End/Speaker/Topic, GuildApplicationPremiumSubscription, Guild incident alert/report types, PurchaseNotification, and PollResult. GuildDiscoveryDisqualified was moved and numeric offsets adjusted to preserve intended values.
Rename FlagSupressEmbeds to FlagSuppressEmbeds and replace an unused placeholder with FlagHasThread. Add additional message flags (FlagFailedToMentionSomeRolesInThread) and introduce a new const block for higher-bit flags: FlagSuppressNotifications, FlagIsVoiceMessage, FlagHasSnapshot, and FlagIsComponentsV2, reorganizing flag definitions for clarity.
Insert new component types (ComponentLabel, ComponentFileUpload) and reorganize the constant blocks to adjust enum offsets. ComponentContainer is moved to start at iota+17 and ComponentRadioGroup at iota+21, shifting subsequent values so the numeric IDs align with the newly added components.
Introduce many new gateway event payloads and expand existing ones to support additional Discord events/fields (auto-moderation, scheduled events, soundboard, stickers, integrations, stage instances, subscriptions, message poll votes, voice channel effects, thread updates, application command permissions, etc.). Update EventType and EventTypes mapping to include new event constants and types. Adjust event structs to use pointer types for optional fields (e.g. guild_id, timestamps, endpoints) and add new fields where required. Fix cache voice state handling: handle nil GuildId when storing voice states (Bolt and Memory caches), use member.User pointer semantics to avoid nil-pointer issues, and update CachedVoiceState.ToVoiceState to return pointer-backed VoiceState values. Also update restwrapper to dereference member user when collecting users. Modify core guild and role models (rename voice_states field, add role icon/unicode emoji/flags and role tags ordering) and add new object types for automoderation and scheduled events. These changes enable support for newer gateway payloads and improve robustness around optional/nullable fields and voice state caching.
Change ThreadMember.ThreadId and ThreadMember.UserId to pointer types with `omitempty` so they can be absent in JSON payloads, and add a Member field (`*member.Member`) to include embedded member data. Also update imports to include the member package. Other fields and behavior remain unchanged.
Reduce PartialChannel to only Id, Type and an optional Name pointer, and update Channel.ToPartialChannel to populate the new shape. Removed several fields (GuildId, Position, Topic, Nsfw, LastMessageId, ParentId, LastPinTimestamp) and unused imports (time, objects). This makes the partial channel payload smaller and allows Name to be omitted when empty via the pointer and `omitempty` JSON tag. https://discord-api-types.dev/api/discord-api-types-v10/interface/APIPartialChannel
Revamp the Message model to better mirror the API and support newer message features: make many fields optional/pointer types and add/rename fields (guild_id, webhook_id, application_id, message_snapshots, interaction_metadata, sticker_items, stickers, position, role_subscription_data, poll, call, etc.). Add new message-related types and files: MessageCall, MessageInteraction (deprecated) and MessageInteractionMetadata, MessageSnapshot, Poll (+ related structs), RoleSubscriptionData, and StickerItem. Also adjust smaller types: MessageActivity.PartyId is now optional, MessageApplication uses pointer fields for nullable values, MessageReference fields are optional, and MessageMentionedUser.Member is now a pointer. These changes improve API parity and enable handling of newer Discord message payloads. https://docs.discord.com/developers/resources/message#message-object
Rename constants EVERYONE/USERS/ROLES to AllowedMentionTypeEveryone/AllowedMentionTypeUsers/AllowedMentionTypeRoles for clearer namespacing and to avoid global uppercase identifiers. Update the MentionEveryone helper to use the new constant. Changes in objects/channel/message/allowedmentiontype.go and objects/channel/message/allowedmention.go. https://docs.discord.com/developers/resources/message#allowed-mentions-object
Add an optional Type field to Embed and mark several embed media fields as optional. Changes: add Type *string to Embed; add omitempty to ProxyUrl, Height and Width in EmbedImage and EmbedThumbnail; add ProxyUrl and set Url/Height/Width to omitempty in EmbedVideo; fix EmbedProvider json tag for Url and mark Name/Url as omitempty. These changes align struct JSON tags with optional Discord embed fields and prevent emitting zero-values. https://docs.discord.com/developers/resources/message#embed-object
Update channel.Attachment to match extended API metadata: change Id tag to `id,string`, add optional fields (Title, Description, ContentType, Ephemeral, DurationSecs, Waveform, Flags) and make previously required fields nullable where appropriate (Height, Width now *int). Use omitempty on optional pointers to correctly handle absent values during JSON (un)marshalling.
Convert many Channel/CachedChannel fields to pointer/omitempty types to support partial/optional channel payloads (name, topic, position, icon, owner/application IDs, timestamps, thread fields, forum tags, etc.). Update Channel<->CachedChannel conversions accordingly. Harden cache and DB code (bolt, memory, pg) to guard against nil GuildId by extracting a zero-value guildId before marshaling/inserting and checking for nil when updating guild maps to avoid nil dereferences. Add ForumTag and DefaultReaction types for forum support. These changes enable safer handling of partial channel objects and prevent panics when GuildId is absent. https://docs.discord.com/developers/resources/channel
Remove `omitempty` from the Id json tag so the Id field is always serialized (as a string). This ensures PermissionOverwrite objects include the id in outgoing JSON, preventing the field from being omitted during marshaling and aligning with expected API behavior. https://docs.discord.com/developers/topics/permissions#permission-overwrites
Add KeywordPresetType and corresponding constants, and change TriggerMetadata.Presets to []KeywordPresetType for clearer preset semantics. Make ActionMetadata.ChannelId and DurationSeconds pointer fields with `omitempty` to represent optional JSON values. Replace Rule.ExemptRoles and ExemptChannels with utils.Uint64StringSlice to standardize uint64-from-string handling. Add import for utils and apply minor formatting/type cleanups. https://docs.discord.com/developers/resources/auto-moderation
Rename EntitlementType constants in objects/entitlement/entitlement.go to include the 'EntitlementType' prefix (e.g. TypePurchase -> EntitlementTypePurchase) for improved clarity and to avoid potential name collisions. Underlying constant values are unchanged. https://docs.discord.com/developers/resources/entitlement#entitlement-resource
Change Emoji and CachedEmoji to use pointer types and omitempty tags for optional Discord fields. Name is now *string in both structs; Emoji.User is now *user.User; boolean flags and roles are marked omitempty and an Available *bool was added. Update conversion helpers: CachedEmoji.ToEmoji now accepts a user value pointer and Emoji.ToCachedEmoji safely handles nil User when extracting the user ID. These changes allow representing absent/custom emoji data and avoid zero-value ambiguity when encoding/decoding API payloads. https://docs.discord.com/developers/resources/emoji#emoji-resource
Introduce recurrence types and RecurrenceRule to represent repeating scheduled events (frequency, interval, by-weekday/month/day, count, start/end, etc.). Add RecurrenceNWeekday to support nth-weekday rules. Include a RecurrenceRule pointer on GuildScheduledEvent and update JSON tags for optional pointer ID fields (channel_id, creator_id, entity_id) to use omitempty so empty values are omitted during marshaling. https://docs.discord.com/developers/resources/guild-scheduled-event#guild-scheduled-event
Mark optional Sticker struct fields with `omitempty` in their JSON tags (PackId, Description, Available, GuildId, User, SortValue) so empty or nil values are omitted when marshaling. This prevents null/zero fields from being serialized for optional sticker data. https://docs.discord.com/developers/resources/sticker#sticker-resource
Convert many guild and integration struct fields to pointer types with `omitempty` to correctly represent optional/absent values from the API. Add support for stickers (import and fields in Guild, GuildPreview), introduce IncidentsData and IntegrationApplication structs, and expand RoleTags with new tag fields. Adjust related types and logic: Ban.Reason, Guild.IconUrl (handle nullable icon), GuildWidget.InstantInvite, GuildEmbed.ChannelId (NullableSnowflake), WelcomeScreen.Description, CachedGuild field nullability and ToGuild mapping for WidgetEnabled. These changes align the models with updated Discord API responses and optional fields. https://docs.discord.com/developers/resources/guild
Replace the previous minimal set of GuildFeature constants with an expanded list to reflect newer Discord guild feature flags. Adds many new entries (e.g., ANIMATED_BANNER, ANIMATED_ICON, APPLICATION_COMMAND_PERMISSIONS_V2, AUTO_MODERATION, COMMUNITY, ROLE_SUBSCRIPTIONS_*, TICKETED_EVENTS_ENABLED, WELCOME_SCREEN_ENABLED, and others) while preserving existing flags like INVITE_SPLASH, VIP_REGIONS, VERIFIED, PARTNERED, NEWS, BANNER, FEATURABLE, and VANITY_URL. This update brings the code in line with updated Discord API feature flags. https://docs.discord.com/developers/resources/guild#guild-object-guild-features
Make Webhook fields nullable/optional to match API semantics: GuildId and ChannelId use pointer/NullableSnowflake types, User/Name/Avatar are now optional pointers. Add SourceGuild struct and SourceChannel/Url fields for channel follower webhooks. Also add WebhookTypeApplication constant (3) and import channel package for PartialChannel. https://docs.discord.com/developers/resources/webhook#webhook-object-webhook-types
Rename Visibility -> ConnectionVisibility and update its constants; change Connection struct fields: Revoked is now *bool with omitempty, Integrations is omitempty, added TwoWayLink, adjusted Type comment, and Visibility uses the new ConnectionVisibility type. Also rename IntegrationExpireBehaviour constants to prefixed names (IntegrationExpireBehaviourRemoveRole, IntegrationExpireBehaviourKick) for clarity. https://docs.discord.com/developers/resources/guild#integration-object
Replace occurrences of ComponentSelectMenu with ComponentStringSelect across component types and handling. Updated the Component enum, component UnmarshalJSON switch, SelectMenu Type/MarshalJSON/BuildSelectMenu implementations, and select menu interaction data/type checks so the select menu is treated as a String Select component. No functional changes beyond the identifier rename. https://docs.discord.com/developers/components/reference#component-reference
Extend and modernize ApplicationCommand and ApplicationCommandOption definitions: rename/standardize JSON tags, add new fields (guild_id, default_member_permissions, nsfw, version), and make several fields optional (options, focused, required, autocomplete). Add numeric/string bounds (min_value, max_value, min_length, max_length) for options and introduce a new ApplicationCommandType constant (PrimaryEntryPoint). Also rename option enum constants to more explicit ApplicationCommandOptionType* names. These changes align the types with updated API field names and optionality, and improve validation support for option values. https://docs.discord.com/developers/interactions/application-commands#application-commands
Rename several ResponseType constants and realign their numeric values. ACKWithSource was renamed to DeferredChannelMessageWithSource and DeferredMessageUpdate to DeferredUpdateMessage; response constructors were updated accordingly. Const blocks were restructured to adjust iota offsets (e.g. Pong is now 0), PremiumRequired marked deprecated, and a new LaunchActivity constant was added. Note: this changes constant names and their numeric assignments, which may be a breaking change for code relying on the previous values. https://docs.discord.com/developers/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type
Revamp Invite types and fields to match updated Discord API payloads. Introduces InviteType and InviteTargetType enums, adds/renames fields on Invite (Type, TargetType, TargetApplication, ExpiresAt, GuildScheduledEvent, Flags, Roles), and converts several fields to pointers with omitempty (Guild, Channel -> PartialChannel, Inviter, TargetUser). Also updates CreateInviteData to use TargetType JSON field name and imports application and scheduledevent packages. These changes allow support for embedded applications, scheduled events and optional invite properties; note this is a breaking change to the Invite structure and JSON tags. https://docs.discord.com/developers/resources/invite#invite-resource
Add AvatarDecorationData struct and include it on Member to support avatar decoration metadata. Also add `omitempty` to Pending, Permissions and CommunicationDisabledUntil JSON tags to avoid emitting null/empty values during serialization and tidy up struct field formatting. https://docs.discord.com/developers/resources/guild#guild-member-object
Update the SoundboardSound struct's GuildId field tag to include `omitempty` (`guild_id,string,omitempty`). This ensures a nil GuildId pointer is omitted from JSON output instead of being emitted, improving marshaling behavior when the guild ID is absent. No functional logic changes. https://docs.discord.com/developers/resources/soundboard#soundboard-resource
Introduce StagePrivacyLevel enum and switch StageInstance.PrivacyLevel from int to this new type for stronger typing. Change GuildScheduledEventId from *uint64 to objects.NullableSnowflake to handle JSON nulls more explicitly and remove the `,string` tag. Make DiscoverableDisabled omit empty values in JSON and add the required import for objects. https://docs.discord.com/developers/resources/stage-instance#stage-instance-resource
Align component objects with the updated API schema: add optional Id fields across many component types, introduce SelectDefaultValue and related types to support default selections (DefaultValues) on select components, add ChannelTypes to ChannelSelect and import channel package, make many fields optional (add `omitempty`) for accurate JSON marshaling, change UnfurledMediaItem fields to optional pointers and require Media where appropriate, and adjust other component fields (Label, Button, InputText, etc.) to match the new shape. These changes enable component IDs, default selected values, improved optional handling, and better compatibility with the upstream component model. https://docs.discord.com/developers/components/reference
Rename the ManageEmojis permission to ManageGuildExpressions across the file (constant name, string representation, and AllPermissions list) to improve naming clarity. Also add a new BypassSlowmode permission and include it in the String() switch and AllPermissions slice. https://docs.discord.com/developers/topics/permissions
Update rest/channel.go to expand channel and message APIs: add new optional fields to ModifyChannelData (defaults, flags, thread defaults), extend EditMessageData with allowed mentions, attachments and components, and add GetAttachments helper. EditMessage now selects JSON vs multipart based on attachments. CreateInviteData now supports target_user_id and target_application_id. Change DeleteChannelPermissions to use nil content type and add FollowAnnouncementChannel to follow news channels. Thread APIs: add ListThreadMembersData with query builder and update ListThreadMembers signature, make thread-start payload fields optional and add rate limit fields, fix archived threads endpoint path, and normalize thread 'before' timestamp formatting to RFC3339 UTC. https://docs.discord.com/developers/resources/channel
Refactor guild REST layer: make many request payload fields pointers with `omitempty` and add new fields (discovery_splash, system_channel_flags, features, description, premium_progress_bar_enabled, safety_alerts_channel_id, etc.). Extend channel/position structs with new channel options and permissions/parent support. Convert member modification fields to pointers and add communication_disabled_until and flags. Change many no-body endpoints to use request.Nil ContentType. Replace prune query API with BeginGuildPruneData body. Adjust ban payload field to delete_message_seconds. Update role payload to support icon and unicode_emoji. Rename and split widget/embed endpoints: introduce GetGuildWidgetSettings/ModifyGuildWidget, keep deprecated ModifyGuildEmbed wrapper, and reintroduce GetGuildWidget for the legacy widget.json. Add time import for communication timeout handling. https://docs.discord.com/developers/resources/guild
Add endpoints to retrieve a single global or guild application command (GetGlobalCommand, GetGuildCommand) and add with_localizations query option to list endpoints. Expand CreateCommandData with localization fields, permissions, integration types, nsfw, handler and other optional fields to match Discord API command payloads. Register new ratelimit route constants for per-command GETs and fix webhook route used for deleting the original interaction response. Also import the application package where required.
Add support for fetching and deleting webhook messages (GetWebhookMessage, DeleteWebhookMessage) and corresponding rate-limit routes. Change EditWebhookMessage to use PATCH (previously POST) for both JSON and multipart branches. Also update WebhookBody: make Tts omitempty and add ThreadId to support thread targeting. These changes align the client with Discord webhook message API semantics and thread support. https://docs.discord.com/developers/resources/webhook
Add RouteGetCurrentUserGuildMember and implement GetCurrentUserGuildMember to fetch the current user's guild member object. Make ModifyUserData fields more explicit: Avatar and Banner are optional pointers; Username formatting adjusted. Improve CurrentUserGuildsData handling: only set limit when 1-200 and add with_counts flag to include member counts. Also simplify some endpoint strings (remove unnecessary fmt.Sprintf) and import the member package. These changes enable fetching guild member info, optional avatar/banner updates, and more correct guild list query params. https://docs.discord.com/developers/resources/user
Introduce ActivityLocation and ActivityInstance types (objects/application/activityinstance.go) and add a GetActivityInstance REST function to fetch /applications/:id/activity-instances/:instance_id. Expand EditCurrentApplicationData with additional fields (integration types config, icon, cover image, event webhooks, etc.) and register RouteGetActivityInstance in ratelimit routes. Also add fmt import used for endpoint formatting. https://docs.discord.com/developers/resources/application
Add an After field to GetGuildAuditLogData and include the 'after' query parameter when non-zero to support pagination. Make Limit optional (omitted if 0) and only include it in the query when its value is between 1 and 100; previously invalid limits were coerced to 50 and always sent. This prevents sending invalid limit values and aligns query behavior with API expectations. https://docs.discord.com/developers/resources/audit-log
Add support for application-scoped emojis: list, get, create, modify and delete in rest/emojis.go (including ListApplicationEmojisResponse and CreateApplicationEmojiData with image encoding). Fix ModifyGuildEmoji to use application/json content type. Add corresponding route constants for application emoji endpoints in rest/ratelimit/routes.go so the rate limiter can handle these new routes. https://docs.discord.com/developers/resources/emoji
Add GetEntitlement API call and route constant; fix/query improvements and parameter renames for entitlements. Changes include: add RouteGetEntitlement; implement GetEntitlement endpoint; rename EntitlementQueryOptions fields (ExcludedEnded -> ExcludeEnded, add ExcludeDeleted) and update query param keys to exclude_ended/exclude_deleted; fix SKU list encoding to avoid trailing comma; switch several endpoints to request.Nil content type; simplify request return handling; correct rateLimiter/variable name typos. https://docs.discord.com/developers/resources/entitlement
Add an optional guildScheduledEventId (*uint64) parameter to GetInvite and append guild_scheduled_event_id to the /invites/{code} query when provided. The endpoint URL is now built in a variable to include with_counts and the optional scheduled event id. Also simplified DeleteInvite endpoint construction by using string concatenation. https://docs.discord.com/developers/resources/invite
Add support for guild voice state operations. Introduces new rate-limit route constants and implements GetCurrentUserVoiceState, GetUserVoiceState, ModifyCurrentUserVoiceState, and ModifyUserVoiceState in rest/voice.go, including request payload structs and a time import. These use the ratelimiter and request.Endpoint to call the /guilds/:id/voice-states endpoints. https://docs.discord.com/developers/resources/voice
Introduce support for the GET /oauth2/@me endpoint by adding an AuthorizationInformation struct and GetCurrentAuthorizationInformation helper that requests bearer-token-only authorization info (application, scopes, expires time and optional user). Also add the GrantTypeClientCredentials constant and a corresponding rate limit route constant for the new endpoint. https://docs.discord.com/developers/topics/oauth2
Replace the deprecated ioutil.ReadAll call with io.ReadAll and remove the unused ioutil import in rest/image.go. This updates the code to the Go 1.16+ standard library usage and removes an unused import.
Pass an empty ListThreadMembersData to the updated rest.ListThreadMembers signature in gateway/restwrapper.go. Tighten up object definitions: use concrete GuildScheduledEvent type in AuditLog, reformat and add TriggeringInteractionMetadata to MessageInteractionMetadata, and mark VoiceState.Member as omitempty to avoid emitting empty member objects. These changes align structs with updated API payloads and function signatures.
Introduce multiple new REST handlers and types to support additional Discord API features: auto-moderation, scheduled events, polls, soundboard, stage instances, stickers, subscriptions, and SKU listing. Add objects/sku SKU type and flags. Update ratelimit route enums and gateway restwrapper calls (BeginGuildPrune signature, GetInvite, GetGlobalCommands, GetGuildCommands) and add guild welcome screen and AddGuildMember helpers. These changes extend API coverage for newer endpoints and wire them into the existing rate limiter/request system.
This was referenced Mar 4, 2026
Reorganize object packages by moving soundboard and stage into objects/guild and update all affected imports. Rename gateway/payloads/events/eventtypes.go to registry.go and adjust references in gateway payloads and REST clients (gateway/payloads/events/guildsoundboard.go, gateway/payloads/events/stageinstances.go, rest/soundboard.go, rest/stage.go) to use the new paths.
Replace hardcoded numeric enum values with iota across many object packages. Constants were converted to use iota (with iota+N and blank identifiers where needed to preserve offsets) and large const blocks were reorganized (notably auditlog). Affected files include application, automoderation, channel, guild, integration, interaction, invite, sku, auditlog, and related enums. This refactor simplifies enum maintenance without changing intended numeric values.
Normalize spacing in enum/const declarations across several files for consistent formatting. Affected files: objects/guild/scheduledevent/scheduledevent.go (RecurrenceFrequency, RecurrenceWeekday, RecurrenceMonth), objects/guild/sticker/sticker.go (StickerFormatType), objects/interaction/applicationcommandpermissions.go (ApplicationCommandPermissionType), and objects/subscription/subscription.go (SubscriptionStatus). No functional changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fully updated gdl, with all types, and all new endpoints
Got all the types and endpoints from https://docs.discord.com and https://discord-api-types.dev
Ticket context:
This will break a lot of services as a lot of the types where wrong, i will be updating them and adding them under here
Ordered:
First
#12
Then update gdl in
TicketsBot-cloud/logarchiver#7
TicketsBot-cloud/subscriptions-app#4
TicketsBot-cloud/status-updates#4
TicketsBot-cloud/discord-entitlements-db-sync#2
Then update gdl and logarchiver
TicketsBot-cloud/worker#119
TicketsBot-cloud/gdpr-worker#4
Then update gdl, worker and logarchiver
TicketsBot-cloud/dashboard#97
Type of Change