Skip to content

Commit

Permalink
fix: add missing soundboard types (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdanialraza authored Nov 5, 2024
1 parent 736479c commit 88d8bed
Show file tree
Hide file tree
Showing 10 changed files with 204 additions and 28 deletions.
40 changes: 38 additions & 2 deletions deno/gateway/v10.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ export enum GatewayIntentBits {
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
*/
GuildBans = GuildModeration,
GuildEmojisAndStickers = 1 << 3,
GuildExpressions = 1 << 3,
/**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildExpressions}
*/
GuildEmojisAndStickers = GuildExpressions,
GuildIntegrations = 1 << 4,
GuildWebhooks = 1 << 5,
GuildInvites = 1 << 6,
Expand Down Expand Up @@ -253,6 +257,7 @@ export enum GatewayDispatchEvents {
GuildSoundboardSoundDelete = 'GUILD_SOUNDBOARD_SOUND_DELETE',
GuildSoundboardSoundsUpdate = 'GUILD_SOUNDBOARD_SOUNDS_UPDATE',
GuildSoundboardSoundUpdate = 'GUILD_SOUNDBOARD_SOUND_UPDATE',
SoundboardSounds = 'SOUNDBOARD_SOUNDS',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
Expand Down Expand Up @@ -362,6 +367,7 @@ export type GatewayDispatchPayload =
| GatewayPresenceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewaySoundboardSoundsDispatch
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
Expand Down Expand Up @@ -903,9 +909,17 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
* See https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
*/
guild_scheduled_events: APIGuildScheduledEvent[];
/**
* The soundboard sounds in the guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* See https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object
*/
soundboard_sounds: APISoundboardSound[];
}

/**
Expand Down Expand Up @@ -1374,6 +1388,28 @@ export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
guild_id: Snowflake;
}

/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export type GatewaySoundboardSoundsDispatch = DataPayload<
GatewayDispatchEvents.SoundboardSounds,
GatewaySoundboardSoundsDispatchData
>;

/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export interface GatewaySoundboardSoundsDispatchData {
/**
* The guild's soundboard sounds
*/
soundboard_sounds: APISoundboardSound[];
/**
* The id of the guild
*/
guild_id: Snowflake;
}

/**
* https://discord.com/developers/docs/topics/gateway-events#integration-create
*/
Expand Down
40 changes: 38 additions & 2 deletions deno/gateway/v9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ export enum GatewayIntentBits {
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
*/
GuildBans = GuildModeration,
GuildEmojisAndStickers = 1 << 3,
GuildExpressions = 1 << 3,
/**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildExpressions}
*/
GuildEmojisAndStickers = GuildExpressions,
GuildIntegrations = 1 << 4,
GuildWebhooks = 1 << 5,
GuildInvites = 1 << 6,
Expand Down Expand Up @@ -252,6 +256,7 @@ export enum GatewayDispatchEvents {
GuildSoundboardSoundDelete = 'GUILD_SOUNDBOARD_SOUND_DELETE',
GuildSoundboardSoundsUpdate = 'GUILD_SOUNDBOARD_SOUNDS_UPDATE',
GuildSoundboardSoundUpdate = 'GUILD_SOUNDBOARD_SOUND_UPDATE',
SoundboardSounds = 'SOUNDBOARD_SOUNDS',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
Expand Down Expand Up @@ -361,6 +366,7 @@ export type GatewayDispatchPayload =
| GatewayPresenceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewaySoundboardSoundsDispatch
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
Expand Down Expand Up @@ -902,9 +908,17 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
* See https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
*/
guild_scheduled_events: APIGuildScheduledEvent[];
/**
* The soundboard sounds in the guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* See https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object
*/
soundboard_sounds: APISoundboardSound[];
}

/**
Expand Down Expand Up @@ -1373,6 +1387,28 @@ export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
guild_id: Snowflake;
}

/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export type GatewaySoundboardSoundsDispatch = DataPayload<
GatewayDispatchEvents.SoundboardSounds,
GatewaySoundboardSoundsDispatchData
>;

/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export interface GatewaySoundboardSoundsDispatchData {
/**
* The guild's soundboard sounds
*/
soundboard_sounds: APISoundboardSound[];
/**
* The id of the guild
*/
guild_id: Snowflake;
}

/**
* https://discord.com/developers/docs/topics/gateway-events#integration-create
*/
Expand Down
12 changes: 8 additions & 4 deletions deno/payloads/v10/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,10 @@ export enum GuildFeature {
* Guild has enabled Membership Screening
*/
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
/**
* Guild has increased custom soundboard sound slots
*/
MoreSoundboard = 'MORE_SOUNDBOARD',
/**
* Guild has enabled monetization
*
Expand Down Expand Up @@ -514,6 +518,10 @@ export enum GuildFeature {
* Guild has enabled role subscriptions
*/
RoleSubscriptionsEnabled = 'ROLE_SUBSCRIPTIONS_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
/**
* Guild has enabled ticketed events
*/
Expand All @@ -534,10 +542,6 @@ export enum GuildFeature {
* Guild has enabled the welcome screen
*/
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
}

/**
Expand Down
12 changes: 8 additions & 4 deletions deno/payloads/v9/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ export enum GuildFeature {
* Guild has enabled Membership Screening
*/
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
/**
* Guild has increased custom soundboard sound slots
*/
MoreSoundboard = 'MORE_SOUNDBOARD',
/**
* Guild has enabled monetization
*
Expand Down Expand Up @@ -506,6 +510,10 @@ export enum GuildFeature {
* Guild has enabled role subscriptions
*/
RoleSubscriptionsEnabled = 'ROLE_SUBSCRIPTIONS_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
/**
* Guild has enabled ticketed events
*/
Expand All @@ -526,10 +534,6 @@ export enum GuildFeature {
* Guild has enabled the welcome screen
*/
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
}

/**
Expand Down
12 changes: 10 additions & 2 deletions deno/rest/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export enum RESTJSONErrorCodes {

UnknownTag = 10_087,

UnknownSound = 10_097,

BotsCannotUseThisEndpoint = 20_001,
OnlyBotsCanUseThisEndpoint,

Expand Down Expand Up @@ -116,7 +118,8 @@ export enum RESTJSONErrorCodes {

MaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReached = 30_042,

MaximumNumberOfEditsToMessagesOlderThanOneHourReached = 30_046,
MaximumNumberOfSoundboardSoundsReached = 30_045,
MaximumNumberOfEditsToMessagesOlderThanOneHourReached,
MaximumNumberOfPinnedThreadsInForumHasBeenReached,
MaximumNumberOfTagsInForumHasBeenReached,

Expand Down Expand Up @@ -237,7 +240,8 @@ export enum RESTJSONErrorCodes {
RequestBodyContainsInvalidJSON = 50_109,
ProvidedFileIsInvalid,

ProvidedFileDurationExceedsMaximumLength = 50_124,
ProvidedFileTypeIsInvalid = 50_123,
ProvidedFileDurationExceedsMaximumLength,

OwnerCannotBePendingMember = 50_131,
OwnershipCannotBeMovedToABotUser,
Expand All @@ -248,6 +252,8 @@ export enum RESTJSONErrorCodes {
CannotConvertBetweenPremiumEmojiAndNormalEmoji,
UploadedFileNotFound,

SpecifiedEmojiIsInvalid = 50_151,

VoiceMessagesDoNotSupportAdditionalContent = 50_159,
VoiceMessagesMustHaveASingleAudioAttachment,
VoiceMessagesMustHaveSupportingMetadata,
Expand All @@ -258,6 +264,8 @@ export enum RESTJSONErrorCodes {

TheUserAccountMustFirstBeVerified = 50_178,

ProvidedFileDoesNotHaveAValidDuration = 50_192,

YouDoNotHavePermissionToSendThisSticker = 50_600,

TwoFactorAuthenticationIsRequired = 60_003,
Expand Down
40 changes: 38 additions & 2 deletions gateway/v10.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ export enum GatewayIntentBits {
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
*/
GuildBans = GuildModeration,
GuildEmojisAndStickers = 1 << 3,
GuildExpressions = 1 << 3,
/**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildExpressions}
*/
GuildEmojisAndStickers = GuildExpressions,
GuildIntegrations = 1 << 4,
GuildWebhooks = 1 << 5,
GuildInvites = 1 << 6,
Expand Down Expand Up @@ -253,6 +257,7 @@ export enum GatewayDispatchEvents {
GuildSoundboardSoundDelete = 'GUILD_SOUNDBOARD_SOUND_DELETE',
GuildSoundboardSoundsUpdate = 'GUILD_SOUNDBOARD_SOUNDS_UPDATE',
GuildSoundboardSoundUpdate = 'GUILD_SOUNDBOARD_SOUND_UPDATE',
SoundboardSounds = 'SOUNDBOARD_SOUNDS',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
Expand Down Expand Up @@ -362,6 +367,7 @@ export type GatewayDispatchPayload =
| GatewayPresenceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewaySoundboardSoundsDispatch
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
Expand Down Expand Up @@ -903,9 +909,17 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
* See https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
*/
guild_scheduled_events: APIGuildScheduledEvent[];
/**
* The soundboard sounds in the guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* See https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object
*/
soundboard_sounds: APISoundboardSound[];
}

/**
Expand Down Expand Up @@ -1374,6 +1388,28 @@ export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
guild_id: Snowflake;
}

/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export type GatewaySoundboardSoundsDispatch = DataPayload<
GatewayDispatchEvents.SoundboardSounds,
GatewaySoundboardSoundsDispatchData
>;

/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export interface GatewaySoundboardSoundsDispatchData {
/**
* The guild's soundboard sounds
*/
soundboard_sounds: APISoundboardSound[];
/**
* The id of the guild
*/
guild_id: Snowflake;
}

/**
* https://discord.com/developers/docs/topics/gateway-events#integration-create
*/
Expand Down
Loading

0 comments on commit 88d8bed

Please sign in to comment.