feat: soundboard (#1113)

Co-authored-by: Micah Benac <OfficialSirH@users.noreply.github.com>
This commit is contained in:
Danial Raza
2024-10-13 18:03:05 +02:00
committed by GitHub
parent ec9819bb2d
commit 8d46830046
26 changed files with 1312 additions and 96 deletions

View File

@@ -36,6 +36,7 @@ import type {
APIEntitlement,
ChannelType,
APISubscription,
APISoundboardSound,
} from '../payloads/v10/mod.ts';
import type { ReactionType } from '../rest/v10/mod.ts';
import type { Nullable } from '../utils/internals.ts';
@@ -93,6 +94,10 @@ export enum GatewayOpcodes {
* Sent in response to receiving a heartbeat to acknowledge that it has been received
*/
HeartbeatAck,
/**
* Request information about soundboard sounds in a set of guilds
*/
RequestSoundboardSounds = 31,
}
/**
@@ -214,10 +219,18 @@ export enum GatewayIntentBits {
*/
export enum GatewayDispatchEvents {
ApplicationCommandPermissionsUpdate = 'APPLICATION_COMMAND_PERMISSIONS_UPDATE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
ChannelUpdate = 'CHANNEL_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
GuildBanAdd = 'GUILD_BAN_ADD',
GuildBanRemove = 'GUILD_BAN_REMOVE',
GuildCreate = 'GUILD_CREATE',
@@ -231,6 +244,15 @@ export enum GatewayDispatchEvents {
GuildRoleCreate = 'GUILD_ROLE_CREATE',
GuildRoleDelete = 'GUILD_ROLE_DELETE',
GuildRoleUpdate = 'GUILD_ROLE_UPDATE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
GuildSoundboardSoundCreate = 'GUILD_SOUNDBOARD_SOUND_CREATE',
GuildSoundboardSoundDelete = 'GUILD_SOUNDBOARD_SOUND_DELETE',
GuildSoundboardSoundsUpdate = 'GUILD_SOUNDBOARD_SOUNDS_UPDATE',
GuildSoundboardSoundUpdate = 'GUILD_SOUNDBOARD_SOUND_UPDATE',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
@@ -242,17 +264,22 @@ export enum GatewayDispatchEvents {
MessageCreate = 'MESSAGE_CREATE',
MessageDelete = 'MESSAGE_DELETE',
MessageDeleteBulk = 'MESSAGE_DELETE_BULK',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
MessageReactionAdd = 'MESSAGE_REACTION_ADD',
MessageReactionRemove = 'MESSAGE_REACTION_REMOVE',
MessageReactionRemoveAll = 'MESSAGE_REACTION_REMOVE_ALL',
MessageReactionRemoveEmoji = 'MESSAGE_REACTION_REMOVE_EMOJI',
MessageUpdate = 'MESSAGE_UPDATE',
PresenceUpdate = 'PRESENCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
StageInstanceCreate = 'STAGE_INSTANCE_CREATE',
StageInstanceDelete = 'STAGE_INSTANCE_DELETE',
StageInstanceUpdate = 'STAGE_INSTANCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
SubscriptionCreate = 'SUBSCRIPTION_CREATE',
SubscriptionDelete = 'SUBSCRIPTION_DELETE',
SubscriptionUpdate = 'SUBSCRIPTION_UPDATE',
ThreadCreate = 'THREAD_CREATE',
ThreadDelete = 'THREAD_DELETE',
ThreadListSync = 'THREAD_LIST_SYNC',
@@ -265,30 +292,13 @@ export enum GatewayDispatchEvents {
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
WebhooksUpdate = 'WEBHOOKS_UPDATE',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
SubscriptionCreate = 'SUBSCRIPTION_CREATE',
SubscriptionUpdate = 'SUBSCRIPTION_UPDATE',
SubscriptionDelete = 'SUBSCRIPTION_DELETE',
}
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayRequestGuildMembers
| GatewayRequestSoundboardSounds
| GatewayResume
| GatewayUpdatePresence
| GatewayVoiceStateUpdate;
@@ -328,6 +338,10 @@ export type GatewayDispatchPayload =
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildSoundboardSoundCreateDispatch
| GatewayGuildSoundboardSoundDeleteDispatch
| GatewayGuildSoundboardSoundsUpdateDispatch
| GatewayGuildSoundboardSoundUpdateDispatch
| GatewayGuildStickersUpdateDispatch
| GatewayIntegrationCreateDispatch
| GatewayIntegrationDeleteDispatch
@@ -1290,6 +1304,76 @@ export interface GatewayGuildScheduledEventUserRemoveDispatchData {
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundCreate,
GatewayGuildSoundboardSoundCreateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundUpdate,
GatewayGuildSoundboardSoundUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export type GatewayGuildSoundboardSoundDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundDelete,
GatewayGuildSoundboardSoundDeleteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export interface GatewayGuildSoundboardSoundDeleteDispatchData {
/**
* The id of the sound that was deleted
*/
sound_id: Snowflake;
/**
* The id of the guild the sound was in
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export type GatewayGuildSoundboardSoundsUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundsUpdate,
GatewayGuildSoundboardSoundsUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
/**
* 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
*/
@@ -2199,6 +2283,24 @@ export type GatewayRequestGuildMembersData =
| GatewayRequestGuildMembersDataWithQuery
| GatewayRequestGuildMembersDataWithUserIds;
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSounds {
op: GatewayOpcodes.RequestSoundboardSounds;
d: GatewayRequestSoundboardSoundsData;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSoundsData {
/**
* The ids of the guilds to get soundboard sounds for
*/
guild_ids: Snowflake[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
*/

View File

@@ -35,6 +35,7 @@ import type {
APIAuditLogEntry,
ChannelType,
APISubscription,
APISoundboardSound,
} from '../payloads/v9/mod.ts';
import type { ReactionType } from '../rest/v9/mod.ts';
import type { Nullable } from '../utils/internals.ts';
@@ -93,6 +94,10 @@ export enum GatewayOpcodes {
* Sent in response to receiving a heartbeat to acknowledge that it has been received
*/
HeartbeatAck,
/**
* Request information about soundboard sounds in a set of guilds
*/
RequestSoundboardSounds = 31,
}
/**
@@ -213,10 +218,18 @@ export enum GatewayIntentBits {
*/
export enum GatewayDispatchEvents {
ApplicationCommandPermissionsUpdate = 'APPLICATION_COMMAND_PERMISSIONS_UPDATE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
ChannelUpdate = 'CHANNEL_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
GuildBanAdd = 'GUILD_BAN_ADD',
GuildBanRemove = 'GUILD_BAN_REMOVE',
GuildCreate = 'GUILD_CREATE',
@@ -230,6 +243,15 @@ export enum GatewayDispatchEvents {
GuildRoleCreate = 'GUILD_ROLE_CREATE',
GuildRoleDelete = 'GUILD_ROLE_DELETE',
GuildRoleUpdate = 'GUILD_ROLE_UPDATE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
GuildSoundboardSoundCreate = 'GUILD_SOUNDBOARD_SOUND_CREATE',
GuildSoundboardSoundDelete = 'GUILD_SOUNDBOARD_SOUND_DELETE',
GuildSoundboardSoundsUpdate = 'GUILD_SOUNDBOARD_SOUNDS_UPDATE',
GuildSoundboardSoundUpdate = 'GUILD_SOUNDBOARD_SOUND_UPDATE',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
@@ -241,17 +263,22 @@ export enum GatewayDispatchEvents {
MessageCreate = 'MESSAGE_CREATE',
MessageDelete = 'MESSAGE_DELETE',
MessageDeleteBulk = 'MESSAGE_DELETE_BULK',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
MessageReactionAdd = 'MESSAGE_REACTION_ADD',
MessageReactionRemove = 'MESSAGE_REACTION_REMOVE',
MessageReactionRemoveAll = 'MESSAGE_REACTION_REMOVE_ALL',
MessageReactionRemoveEmoji = 'MESSAGE_REACTION_REMOVE_EMOJI',
MessageUpdate = 'MESSAGE_UPDATE',
PresenceUpdate = 'PRESENCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
StageInstanceCreate = 'STAGE_INSTANCE_CREATE',
StageInstanceDelete = 'STAGE_INSTANCE_DELETE',
StageInstanceUpdate = 'STAGE_INSTANCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
SubscriptionCreate = 'SUBSCRIPTION_CREATE',
SubscriptionDelete = 'SUBSCRIPTION_DELETE',
SubscriptionUpdate = 'SUBSCRIPTION_UPDATE',
ThreadCreate = 'THREAD_CREATE',
ThreadDelete = 'THREAD_DELETE',
ThreadListSync = 'THREAD_LIST_SYNC',
@@ -264,30 +291,13 @@ export enum GatewayDispatchEvents {
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
WebhooksUpdate = 'WEBHOOKS_UPDATE',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
SubscriptionCreate = 'SUBSCRIPTION_CREATE',
SubscriptionUpdate = 'SUBSCRIPTION_UPDATE',
SubscriptionDelete = 'SUBSCRIPTION_DELETE',
}
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayRequestGuildMembers
| GatewayRequestSoundboardSounds
| GatewayResume
| GatewayUpdatePresence
| GatewayVoiceStateUpdate;
@@ -327,6 +337,10 @@ export type GatewayDispatchPayload =
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildSoundboardSoundCreateDispatch
| GatewayGuildSoundboardSoundDeleteDispatch
| GatewayGuildSoundboardSoundsUpdateDispatch
| GatewayGuildSoundboardSoundUpdateDispatch
| GatewayGuildStickersUpdateDispatch
| GatewayIntegrationCreateDispatch
| GatewayIntegrationDeleteDispatch
@@ -1289,6 +1303,76 @@ export interface GatewayGuildScheduledEventUserRemoveDispatchData {
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundCreate,
GatewayGuildSoundboardSoundCreateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundUpdate,
GatewayGuildSoundboardSoundUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export type GatewayGuildSoundboardSoundDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundDelete,
GatewayGuildSoundboardSoundDeleteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export interface GatewayGuildSoundboardSoundDeleteDispatchData {
/**
* The id of the sound that was deleted
*/
sound_id: Snowflake;
/**
* The id of the guild the sound was in
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export type GatewayGuildSoundboardSoundsUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundsUpdate,
GatewayGuildSoundboardSoundsUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
/**
* 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
*/
@@ -2198,6 +2282,24 @@ export type GatewayRequestGuildMembersData =
| GatewayRequestGuildMembersDataWithQuery
| GatewayRequestGuildMembersDataWithUserIds;
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSounds {
op: GatewayOpcodes.RequestSoundboardSounds;
d: GatewayRequestSoundboardSoundsData;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSoundsData {
/**
* The ids of the guilds to get soundboard sounds for
*/
guild_ids: Snowflake[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
*/

View File

@@ -534,6 +534,10 @@ export enum GuildFeature {
* Guild has enabled the welcome screen
*/
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
}
/**

View File

@@ -9,9 +9,11 @@ export * from './guild.ts';
export * from './guildScheduledEvent.ts';
export * from './interactions.ts';
export * from './invite.ts';
export * from './monetization.ts';
export * from './oauth2.ts';
export * from './poll.ts';
export * from './permissions.ts';
export * from './poll.ts';
export * from './soundboard.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './teams.ts';
@@ -19,4 +21,3 @@ export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export * from './monetization.ts';

View File

@@ -0,0 +1,44 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/soundboard
*/
import type { Snowflake } from '../../globals.ts';
import type { APIUser } from './user.ts';
/**
* https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object
*/
export interface APISoundboardSound {
/**
* The name of this sound
*/
name: string;
/**
* The id of this sound
*/
sound_id: Snowflake;
/**
* The volume of this sound, from 0 to 1
*/
volume: number;
/**
* The id of this sound's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of this sound's standard emoji
*/
emoji_name: string | null;
/**
* The id of the guild that this sound is in
*/
guild_id?: Snowflake;
/**
* Whether this sound can be used (for guild sounds), may be false due to loss of Server Boosts
*/
available: boolean;
/**
* The user who created this sound
*/
user?: APIUser;
}

View File

@@ -526,6 +526,10 @@ export enum GuildFeature {
* Guild has enabled the welcome screen
*/
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
}
/**

View File

@@ -9,9 +9,11 @@ export * from './guild.ts';
export * from './guildScheduledEvent.ts';
export * from './interactions.ts';
export * from './invite.ts';
export * from './monetization.ts';
export * from './oauth2.ts';
export * from './poll.ts';
export * from './permissions.ts';
export * from './poll.ts';
export * from './soundboard.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './teams.ts';
@@ -19,4 +21,3 @@ export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export * from './monetization.ts';

View File

@@ -0,0 +1,44 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/soundboard
*/
import type { Snowflake } from '../../globals.ts';
import type { APIUser } from './user.ts';
/**
* https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object
*/
export interface APISoundboardSound {
/**
* The name of this sound
*/
name: string;
/**
* The id of this sound
*/
sound_id: Snowflake;
/**
* The volume of this sound, from 0 to 1
*/
volume: number;
/**
* The id of this sound's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of this sound's standard emoji
*/
emoji_name: string | null;
/**
* The id of the guild that this sound is in
*/
guild_id?: Snowflake;
/**
* Whether this sound can be used (for guild sounds), may be false due to loss of Server Boosts
*/
available: boolean;
/**
* The user who created this sound
*/
user?: APIUser;
}

View File

@@ -22,6 +22,7 @@ export enum RESTJSONErrorCodes {
UnknownWebhookService,
UnknownSession = 10_020,
UnknownAsset,
UnknownBan = 10_026,
UnknownSKU,
@@ -234,6 +235,9 @@ export enum RESTJSONErrorCodes {
ServerNeedsMoreBoostsToPerformThisAction = 50_101,
RequestBodyContainsInvalidJSON = 50_109,
ProvidedFileIsInvalid,
ProvidedFileDurationExceedsMaximumLength = 50_124,
OwnerCannotBePendingMember = 50_131,
OwnershipCannotBeMovedToABotUser,

View File

@@ -11,15 +11,16 @@ export * from './guild.ts';
export * from './guildScheduledEvent.ts';
export * from './interactions.ts';
export * from './invite.ts';
export * from './monetization.ts';
export * from './oauth2.ts';
export * from './poll.ts';
export * from './soundboard.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export * from './monetization.ts';
export const APIVersion = '10';
@@ -1010,11 +1011,46 @@ export const Routes = {
/**
* Route for:
* - GET `/skus/{sku.id}/subscriptions/${subscription.id}`
* - GET `/skus/{sku.id}/subscriptions/{subscription.id}`
*/
skuSubscription(skuId: Snowflake, subscriptionId: Snowflake) {
return `/skus/${skuId}/subscriptions/${subscriptionId}` as const;
},
/**
* Route for:
* - POST `/channels/{channel.id}/send-soundboard-sound`
*/
sendSoundboardSound(channelId: Snowflake) {
return `/channels/${channelId}/send-soundboard-sound` as const;
},
/**
* Route for:
* - GET `/soundboard-default-sounds`
*/
soundboardDefaultSounds() {
return '/soundboard-default-sounds' as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/soundboard-sounds`
* - POST `/guilds/{guild.id}/soundboard-sounds`
*/
guildSoundboardSounds(guildId: Snowflake) {
return `/guilds/${guildId}/soundboard-sounds` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
* - PATCH `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
* - DELETE `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
*/
guildSoundboardSound(guildId: Snowflake, soundId: Snowflake) {
return `/guilds/${guildId}/soundboard-sounds/${soundId}` as const;
},
};
export const StickerPackApplicationId = '710982414301790216';
@@ -1304,6 +1340,14 @@ export const CDNRoutes = {
) {
return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const;
},
/**
* Route for:
* - GET `/soundboard-sounds/${sound.id}`
*/
soundboardSound(soundId: Snowflake) {
return `/soundboard-sounds/${soundId}` as const;
},
};
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;

107
deno/rest/v10/soundboard.ts Normal file
View File

@@ -0,0 +1,107 @@
import type { Snowflake } from '../../globals.ts';
import type { APISoundboardSound } from '../../payloads/v10/mod.ts';
/**
* https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound
*/
export type RESTPostAPISendSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound-json-params
*/
export interface RESTPostAPISoundboardSendSoundJSONBody {
/**
* The id of the soundboard sound to play
*/
sound_id: Snowflake;
/**
* The id of the guild the soundboard sound is from, required to play sounds from different servers
*/
source_guild_id?: Snowflake | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#list-soundboard-default-sounds
*/
export type RESTGetAPISoundboardDefaultSoundsResult = APISoundboardSound[];
/**
* https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds
*/
export interface RESTGetAPIGuildSoundboardSoundsResult {
items: APISoundboardSound[];
}
/**
* https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound
*/
export type RESTGetAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound-json-params
*/
export interface RESTPostAPIGuildSoundboardSoundJSONBody {
/**
* The name of the soundboard sound (2-32 characters)
*/
name: string;
/**
* The data uri of the mp3 or ogg sound data, base64 encoded, similar to image data
*
* See https://discord.com/developers/docs/reference#image-data
*/
sound: string;
/**
* The volume of the soundboard sound, from 0 to 1
*
* @default 1
*/
volume?: number | null | undefined;
/**
* The id of the custom emoji for the soundboard sound
*/
emoji_id?: Snowflake | null | undefined;
/**
* The unicode character of a standard emoji for the soundboard sound
*/
emoji_name?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound
*/
export type RESTPostAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound-json-params
*/
export interface RESTPatchAPIGuildSoundboardSoundJSONBody {
/**
* The name of the soundboard sound (2-32 characters)
*/
name?: string | undefined;
/**
* The volume of the soundboard sound, from 0 to 1
*
* @default 1
*/
volume?: number | null | undefined;
/**
* The id of the custom emoji for the soundboard sound
*/
emoji_id?: Snowflake | null | undefined;
/**
* The unicode character of a standard emoji for the soundboard sound
*/
emoji_name?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound
*/
export type RESTPatchAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound
*/
export type RESTDeleteAPIGuildSoundboardSoundResult = never;

View File

@@ -11,15 +11,16 @@ export * from './guild.ts';
export * from './guildScheduledEvent.ts';
export * from './interactions.ts';
export * from './invite.ts';
export * from './monetization.ts';
export * from './oauth2.ts';
export * from './poll.ts';
export * from './soundboard.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export * from './monetization.ts';
export const APIVersion = '9';
@@ -1019,11 +1020,46 @@ export const Routes = {
/**
* Route for:
* - GET `/skus/{sku.id}/subscriptions/${subscription.id}`
* - GET `/skus/{sku.id}/subscriptions/{subscription.id}`
*/
skuSubscription(skuId: Snowflake, subscriptionId: Snowflake) {
return `/skus/${skuId}/subscriptions/${subscriptionId}` as const;
},
/**
* Route for:
* - POST `/channels/{channel.id}/send-soundboard-sound`
*/
sendSoundboardSound(channelId: Snowflake) {
return `/channels/${channelId}/send-soundboard-sound` as const;
},
/**
* Route for:
* - GET `/soundboard-default-sounds`
*/
soundboardDefaultSounds() {
return '/soundboard-default-sounds' as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/soundboard-sounds`
* - POST `/guilds/{guild.id}/soundboard-sounds`
*/
guildSoundboardSounds(guildId: Snowflake) {
return `/guilds/${guildId}/soundboard-sounds` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
* - PATCH `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
* - DELETE `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
*/
guildSoundboardSound(guildId: Snowflake, soundId: Snowflake) {
return `/guilds/${guildId}/soundboard-sounds/${soundId}` as const;
},
};
export const StickerPackApplicationId = '710982414301790216';
@@ -1313,6 +1349,14 @@ export const CDNRoutes = {
) {
return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const;
},
/**
* Route for:
* - GET `/soundboard-sounds/${sound.id}`
*/
soundboardSound(soundId: Snowflake) {
return `/soundboard-sounds/${soundId}` as const;
},
};
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;

107
deno/rest/v9/soundboard.ts Normal file
View File

@@ -0,0 +1,107 @@
import type { Snowflake } from '../../globals.ts';
import type { APISoundboardSound } from '../../payloads/v10/mod.ts';
/**
* https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound
*/
export type RESTPostAPISendSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound-json-params
*/
export interface RESTPostAPISoundboardSendSoundJSONBody {
/**
* The id of the soundboard sound to play
*/
sound_id: Snowflake;
/**
* The id of the guild the soundboard sound is from, required to play sounds from different servers
*/
source_guild_id?: Snowflake | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#list-soundboard-default-sounds
*/
export type RESTGetAPISoundboardDefaultSoundsResult = APISoundboardSound[];
/**
* https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds
*/
export interface RESTGetAPIGuildSoundboardSoundsResult {
items: APISoundboardSound[];
}
/**
* https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound
*/
export type RESTGetAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound-json-params
*/
export interface RESTPostAPIGuildSoundboardSoundJSONBody {
/**
* The name of the soundboard sound (2-32 characters)
*/
name: string;
/**
* The data uri of the mp3 or ogg sound data, base64 encoded, similar to image data
*
* See https://discord.com/developers/docs/reference#image-data
*/
sound: string;
/**
* The volume of the soundboard sound, from 0 to 1
*
* @default 1
*/
volume?: number | null | undefined;
/**
* The id of the custom emoji for the soundboard sound
*/
emoji_id?: Snowflake | null | undefined;
/**
* The unicode character of a standard emoji for the soundboard sound
*/
emoji_name?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound
*/
export type RESTPostAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound-json-params
*/
export interface RESTPatchAPIGuildSoundboardSoundJSONBody {
/**
* The name of the soundboard sound (2-32 characters)
*/
name?: string | undefined;
/**
* The volume of the soundboard sound, from 0 to 1
*
* @default 1
*/
volume?: number | null | undefined;
/**
* The id of the custom emoji for the soundboard sound
*/
emoji_id?: Snowflake | null | undefined;
/**
* The unicode character of a standard emoji for the soundboard sound
*/
emoji_name?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound
*/
export type RESTPatchAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound
*/
export type RESTDeleteAPIGuildSoundboardSoundResult = never;

View File

@@ -36,6 +36,7 @@ import type {
APIEntitlement,
ChannelType,
APISubscription,
APISoundboardSound,
} from '../payloads/v10/index';
import type { ReactionType } from '../rest/v10/index';
import type { Nullable } from '../utils/internals';
@@ -93,6 +94,10 @@ export enum GatewayOpcodes {
* Sent in response to receiving a heartbeat to acknowledge that it has been received
*/
HeartbeatAck,
/**
* Request information about soundboard sounds in a set of guilds
*/
RequestSoundboardSounds = 31,
}
/**
@@ -214,10 +219,18 @@ export enum GatewayIntentBits {
*/
export enum GatewayDispatchEvents {
ApplicationCommandPermissionsUpdate = 'APPLICATION_COMMAND_PERMISSIONS_UPDATE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
ChannelUpdate = 'CHANNEL_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
GuildBanAdd = 'GUILD_BAN_ADD',
GuildBanRemove = 'GUILD_BAN_REMOVE',
GuildCreate = 'GUILD_CREATE',
@@ -231,6 +244,15 @@ export enum GatewayDispatchEvents {
GuildRoleCreate = 'GUILD_ROLE_CREATE',
GuildRoleDelete = 'GUILD_ROLE_DELETE',
GuildRoleUpdate = 'GUILD_ROLE_UPDATE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
GuildSoundboardSoundCreate = 'GUILD_SOUNDBOARD_SOUND_CREATE',
GuildSoundboardSoundDelete = 'GUILD_SOUNDBOARD_SOUND_DELETE',
GuildSoundboardSoundsUpdate = 'GUILD_SOUNDBOARD_SOUNDS_UPDATE',
GuildSoundboardSoundUpdate = 'GUILD_SOUNDBOARD_SOUND_UPDATE',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
@@ -242,17 +264,22 @@ export enum GatewayDispatchEvents {
MessageCreate = 'MESSAGE_CREATE',
MessageDelete = 'MESSAGE_DELETE',
MessageDeleteBulk = 'MESSAGE_DELETE_BULK',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
MessageReactionAdd = 'MESSAGE_REACTION_ADD',
MessageReactionRemove = 'MESSAGE_REACTION_REMOVE',
MessageReactionRemoveAll = 'MESSAGE_REACTION_REMOVE_ALL',
MessageReactionRemoveEmoji = 'MESSAGE_REACTION_REMOVE_EMOJI',
MessageUpdate = 'MESSAGE_UPDATE',
PresenceUpdate = 'PRESENCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
StageInstanceCreate = 'STAGE_INSTANCE_CREATE',
StageInstanceDelete = 'STAGE_INSTANCE_DELETE',
StageInstanceUpdate = 'STAGE_INSTANCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
SubscriptionCreate = 'SUBSCRIPTION_CREATE',
SubscriptionDelete = 'SUBSCRIPTION_DELETE',
SubscriptionUpdate = 'SUBSCRIPTION_UPDATE',
ThreadCreate = 'THREAD_CREATE',
ThreadDelete = 'THREAD_DELETE',
ThreadListSync = 'THREAD_LIST_SYNC',
@@ -265,30 +292,13 @@ export enum GatewayDispatchEvents {
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
WebhooksUpdate = 'WEBHOOKS_UPDATE',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
SubscriptionCreate = 'SUBSCRIPTION_CREATE',
SubscriptionUpdate = 'SUBSCRIPTION_UPDATE',
SubscriptionDelete = 'SUBSCRIPTION_DELETE',
}
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayRequestGuildMembers
| GatewayRequestSoundboardSounds
| GatewayResume
| GatewayUpdatePresence
| GatewayVoiceStateUpdate;
@@ -328,6 +338,10 @@ export type GatewayDispatchPayload =
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildSoundboardSoundCreateDispatch
| GatewayGuildSoundboardSoundDeleteDispatch
| GatewayGuildSoundboardSoundsUpdateDispatch
| GatewayGuildSoundboardSoundUpdateDispatch
| GatewayGuildStickersUpdateDispatch
| GatewayIntegrationCreateDispatch
| GatewayIntegrationDeleteDispatch
@@ -1290,6 +1304,76 @@ export interface GatewayGuildScheduledEventUserRemoveDispatchData {
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundCreate,
GatewayGuildSoundboardSoundCreateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundUpdate,
GatewayGuildSoundboardSoundUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export type GatewayGuildSoundboardSoundDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundDelete,
GatewayGuildSoundboardSoundDeleteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export interface GatewayGuildSoundboardSoundDeleteDispatchData {
/**
* The id of the sound that was deleted
*/
sound_id: Snowflake;
/**
* The id of the guild the sound was in
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export type GatewayGuildSoundboardSoundsUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundsUpdate,
GatewayGuildSoundboardSoundsUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
/**
* 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
*/
@@ -2199,6 +2283,24 @@ export type GatewayRequestGuildMembersData =
| GatewayRequestGuildMembersDataWithQuery
| GatewayRequestGuildMembersDataWithUserIds;
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSounds {
op: GatewayOpcodes.RequestSoundboardSounds;
d: GatewayRequestSoundboardSoundsData;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSoundsData {
/**
* The ids of the guilds to get soundboard sounds for
*/
guild_ids: Snowflake[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
*/

View File

@@ -35,6 +35,7 @@ import type {
APIAuditLogEntry,
ChannelType,
APISubscription,
APISoundboardSound,
} from '../payloads/v9/index';
import type { ReactionType } from '../rest/v9/index';
import type { Nullable } from '../utils/internals';
@@ -93,6 +94,10 @@ export enum GatewayOpcodes {
* Sent in response to receiving a heartbeat to acknowledge that it has been received
*/
HeartbeatAck,
/**
* Request information about soundboard sounds in a set of guilds
*/
RequestSoundboardSounds = 31,
}
/**
@@ -213,10 +218,18 @@ export enum GatewayIntentBits {
*/
export enum GatewayDispatchEvents {
ApplicationCommandPermissionsUpdate = 'APPLICATION_COMMAND_PERMISSIONS_UPDATE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
ChannelUpdate = 'CHANNEL_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
GuildBanAdd = 'GUILD_BAN_ADD',
GuildBanRemove = 'GUILD_BAN_REMOVE',
GuildCreate = 'GUILD_CREATE',
@@ -230,6 +243,15 @@ export enum GatewayDispatchEvents {
GuildRoleCreate = 'GUILD_ROLE_CREATE',
GuildRoleDelete = 'GUILD_ROLE_DELETE',
GuildRoleUpdate = 'GUILD_ROLE_UPDATE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
GuildSoundboardSoundCreate = 'GUILD_SOUNDBOARD_SOUND_CREATE',
GuildSoundboardSoundDelete = 'GUILD_SOUNDBOARD_SOUND_DELETE',
GuildSoundboardSoundsUpdate = 'GUILD_SOUNDBOARD_SOUNDS_UPDATE',
GuildSoundboardSoundUpdate = 'GUILD_SOUNDBOARD_SOUND_UPDATE',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
@@ -241,17 +263,22 @@ export enum GatewayDispatchEvents {
MessageCreate = 'MESSAGE_CREATE',
MessageDelete = 'MESSAGE_DELETE',
MessageDeleteBulk = 'MESSAGE_DELETE_BULK',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
MessageReactionAdd = 'MESSAGE_REACTION_ADD',
MessageReactionRemove = 'MESSAGE_REACTION_REMOVE',
MessageReactionRemoveAll = 'MESSAGE_REACTION_REMOVE_ALL',
MessageReactionRemoveEmoji = 'MESSAGE_REACTION_REMOVE_EMOJI',
MessageUpdate = 'MESSAGE_UPDATE',
PresenceUpdate = 'PRESENCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
StageInstanceCreate = 'STAGE_INSTANCE_CREATE',
StageInstanceDelete = 'STAGE_INSTANCE_DELETE',
StageInstanceUpdate = 'STAGE_INSTANCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
SubscriptionCreate = 'SUBSCRIPTION_CREATE',
SubscriptionDelete = 'SUBSCRIPTION_DELETE',
SubscriptionUpdate = 'SUBSCRIPTION_UPDATE',
ThreadCreate = 'THREAD_CREATE',
ThreadDelete = 'THREAD_DELETE',
ThreadListSync = 'THREAD_LIST_SYNC',
@@ -264,30 +291,13 @@ export enum GatewayDispatchEvents {
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
WebhooksUpdate = 'WEBHOOKS_UPDATE',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
SubscriptionCreate = 'SUBSCRIPTION_CREATE',
SubscriptionUpdate = 'SUBSCRIPTION_UPDATE',
SubscriptionDelete = 'SUBSCRIPTION_DELETE',
}
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayRequestGuildMembers
| GatewayRequestSoundboardSounds
| GatewayResume
| GatewayUpdatePresence
| GatewayVoiceStateUpdate;
@@ -327,6 +337,10 @@ export type GatewayDispatchPayload =
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildSoundboardSoundCreateDispatch
| GatewayGuildSoundboardSoundDeleteDispatch
| GatewayGuildSoundboardSoundsUpdateDispatch
| GatewayGuildSoundboardSoundUpdateDispatch
| GatewayGuildStickersUpdateDispatch
| GatewayIntegrationCreateDispatch
| GatewayIntegrationDeleteDispatch
@@ -1289,6 +1303,76 @@ export interface GatewayGuildScheduledEventUserRemoveDispatchData {
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundCreate,
GatewayGuildSoundboardSoundCreateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundUpdate,
GatewayGuildSoundboardSoundUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export type GatewayGuildSoundboardSoundDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundDelete,
GatewayGuildSoundboardSoundDeleteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export interface GatewayGuildSoundboardSoundDeleteDispatchData {
/**
* The id of the sound that was deleted
*/
sound_id: Snowflake;
/**
* The id of the guild the sound was in
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export type GatewayGuildSoundboardSoundsUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundsUpdate,
GatewayGuildSoundboardSoundsUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
/**
* 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
*/
@@ -2198,6 +2282,24 @@ export type GatewayRequestGuildMembersData =
| GatewayRequestGuildMembersDataWithQuery
| GatewayRequestGuildMembersDataWithUserIds;
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSounds {
op: GatewayOpcodes.RequestSoundboardSounds;
d: GatewayRequestSoundboardSoundsData;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSoundsData {
/**
* The ids of the guilds to get soundboard sounds for
*/
guild_ids: Snowflake[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
*/

View File

@@ -534,6 +534,10 @@ export enum GuildFeature {
* Guild has enabled the welcome screen
*/
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
}
/**

View File

@@ -9,9 +9,11 @@ export * from './guild';
export * from './guildScheduledEvent';
export * from './interactions';
export * from './invite';
export * from './monetization';
export * from './oauth2';
export * from './poll';
export * from './permissions';
export * from './poll';
export * from './soundboard';
export * from './stageInstance';
export * from './sticker';
export * from './teams';
@@ -19,4 +21,3 @@ export * from './template';
export * from './user';
export * from './voice';
export * from './webhook';
export * from './monetization';

View File

@@ -0,0 +1,44 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/soundboard
*/
import type { Snowflake } from '../../globals';
import type { APIUser } from './user';
/**
* https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object
*/
export interface APISoundboardSound {
/**
* The name of this sound
*/
name: string;
/**
* The id of this sound
*/
sound_id: Snowflake;
/**
* The volume of this sound, from 0 to 1
*/
volume: number;
/**
* The id of this sound's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of this sound's standard emoji
*/
emoji_name: string | null;
/**
* The id of the guild that this sound is in
*/
guild_id?: Snowflake;
/**
* Whether this sound can be used (for guild sounds), may be false due to loss of Server Boosts
*/
available: boolean;
/**
* The user who created this sound
*/
user?: APIUser;
}

View File

@@ -526,6 +526,10 @@ export enum GuildFeature {
* Guild has enabled the welcome screen
*/
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
}
/**

View File

@@ -9,9 +9,11 @@ export * from './guild';
export * from './guildScheduledEvent';
export * from './interactions';
export * from './invite';
export * from './monetization';
export * from './oauth2';
export * from './poll';
export * from './permissions';
export * from './poll';
export * from './soundboard';
export * from './stageInstance';
export * from './sticker';
export * from './teams';
@@ -19,4 +21,3 @@ export * from './template';
export * from './user';
export * from './voice';
export * from './webhook';
export * from './monetization';

44
payloads/v9/soundboard.ts Normal file
View File

@@ -0,0 +1,44 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/soundboard
*/
import type { Snowflake } from '../../globals';
import type { APIUser } from './user';
/**
* https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object
*/
export interface APISoundboardSound {
/**
* The name of this sound
*/
name: string;
/**
* The id of this sound
*/
sound_id: Snowflake;
/**
* The volume of this sound, from 0 to 1
*/
volume: number;
/**
* The id of this sound's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of this sound's standard emoji
*/
emoji_name: string | null;
/**
* The id of the guild that this sound is in
*/
guild_id?: Snowflake;
/**
* Whether this sound can be used (for guild sounds), may be false due to loss of Server Boosts
*/
available: boolean;
/**
* The user who created this sound
*/
user?: APIUser;
}

View File

@@ -22,6 +22,7 @@ export enum RESTJSONErrorCodes {
UnknownWebhookService,
UnknownSession = 10_020,
UnknownAsset,
UnknownBan = 10_026,
UnknownSKU,
@@ -234,6 +235,9 @@ export enum RESTJSONErrorCodes {
ServerNeedsMoreBoostsToPerformThisAction = 50_101,
RequestBodyContainsInvalidJSON = 50_109,
ProvidedFileIsInvalid,
ProvidedFileDurationExceedsMaximumLength = 50_124,
OwnerCannotBePendingMember = 50_131,
OwnershipCannotBeMovedToABotUser,

View File

@@ -11,15 +11,16 @@ export * from './guild';
export * from './guildScheduledEvent';
export * from './interactions';
export * from './invite';
export * from './monetization';
export * from './oauth2';
export * from './poll';
export * from './soundboard';
export * from './stageInstance';
export * from './sticker';
export * from './template';
export * from './user';
export * from './voice';
export * from './webhook';
export * from './monetization';
export const APIVersion = '10';
@@ -1010,11 +1011,46 @@ export const Routes = {
/**
* Route for:
* - GET `/skus/{sku.id}/subscriptions/${subscription.id}`
* - GET `/skus/{sku.id}/subscriptions/{subscription.id}`
*/
skuSubscription(skuId: Snowflake, subscriptionId: Snowflake) {
return `/skus/${skuId}/subscriptions/${subscriptionId}` as const;
},
/**
* Route for:
* - POST `/channels/{channel.id}/send-soundboard-sound`
*/
sendSoundboardSound(channelId: Snowflake) {
return `/channels/${channelId}/send-soundboard-sound` as const;
},
/**
* Route for:
* - GET `/soundboard-default-sounds`
*/
soundboardDefaultSounds() {
return '/soundboard-default-sounds' as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/soundboard-sounds`
* - POST `/guilds/{guild.id}/soundboard-sounds`
*/
guildSoundboardSounds(guildId: Snowflake) {
return `/guilds/${guildId}/soundboard-sounds` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
* - PATCH `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
* - DELETE `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
*/
guildSoundboardSound(guildId: Snowflake, soundId: Snowflake) {
return `/guilds/${guildId}/soundboard-sounds/${soundId}` as const;
},
};
export const StickerPackApplicationId = '710982414301790216';
@@ -1304,6 +1340,14 @@ export const CDNRoutes = {
) {
return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const;
},
/**
* Route for:
* - GET `/soundboard-sounds/${sound.id}`
*/
soundboardSound(soundId: Snowflake) {
return `/soundboard-sounds/${soundId}` as const;
},
};
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;

107
rest/v10/soundboard.ts Normal file
View File

@@ -0,0 +1,107 @@
import type { Snowflake } from '../../globals';
import type { APISoundboardSound } from '../../payloads/v10/index';
/**
* https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound
*/
export type RESTPostAPISendSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound-json-params
*/
export interface RESTPostAPISoundboardSendSoundJSONBody {
/**
* The id of the soundboard sound to play
*/
sound_id: Snowflake;
/**
* The id of the guild the soundboard sound is from, required to play sounds from different servers
*/
source_guild_id?: Snowflake | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#list-soundboard-default-sounds
*/
export type RESTGetAPISoundboardDefaultSoundsResult = APISoundboardSound[];
/**
* https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds
*/
export interface RESTGetAPIGuildSoundboardSoundsResult {
items: APISoundboardSound[];
}
/**
* https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound
*/
export type RESTGetAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound-json-params
*/
export interface RESTPostAPIGuildSoundboardSoundJSONBody {
/**
* The name of the soundboard sound (2-32 characters)
*/
name: string;
/**
* The data uri of the mp3 or ogg sound data, base64 encoded, similar to image data
*
* See https://discord.com/developers/docs/reference#image-data
*/
sound: string;
/**
* The volume of the soundboard sound, from 0 to 1
*
* @default 1
*/
volume?: number | null | undefined;
/**
* The id of the custom emoji for the soundboard sound
*/
emoji_id?: Snowflake | null | undefined;
/**
* The unicode character of a standard emoji for the soundboard sound
*/
emoji_name?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound
*/
export type RESTPostAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound-json-params
*/
export interface RESTPatchAPIGuildSoundboardSoundJSONBody {
/**
* The name of the soundboard sound (2-32 characters)
*/
name?: string | undefined;
/**
* The volume of the soundboard sound, from 0 to 1
*
* @default 1
*/
volume?: number | null | undefined;
/**
* The id of the custom emoji for the soundboard sound
*/
emoji_id?: Snowflake | null | undefined;
/**
* The unicode character of a standard emoji for the soundboard sound
*/
emoji_name?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound
*/
export type RESTPatchAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound
*/
export type RESTDeleteAPIGuildSoundboardSoundResult = never;

View File

@@ -11,15 +11,16 @@ export * from './guild';
export * from './guildScheduledEvent';
export * from './interactions';
export * from './invite';
export * from './monetization';
export * from './oauth2';
export * from './poll';
export * from './soundboard';
export * from './stageInstance';
export * from './sticker';
export * from './template';
export * from './user';
export * from './voice';
export * from './webhook';
export * from './monetization';
export const APIVersion = '9';
@@ -1019,11 +1020,46 @@ export const Routes = {
/**
* Route for:
* - GET `/skus/{sku.id}/subscriptions/${subscription.id}`
* - GET `/skus/{sku.id}/subscriptions/{subscription.id}`
*/
skuSubscription(skuId: Snowflake, subscriptionId: Snowflake) {
return `/skus/${skuId}/subscriptions/${subscriptionId}` as const;
},
/**
* Route for:
* - POST `/channels/{channel.id}/send-soundboard-sound`
*/
sendSoundboardSound(channelId: Snowflake) {
return `/channels/${channelId}/send-soundboard-sound` as const;
},
/**
* Route for:
* - GET `/soundboard-default-sounds`
*/
soundboardDefaultSounds() {
return '/soundboard-default-sounds' as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/soundboard-sounds`
* - POST `/guilds/{guild.id}/soundboard-sounds`
*/
guildSoundboardSounds(guildId: Snowflake) {
return `/guilds/${guildId}/soundboard-sounds` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
* - PATCH `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
* - DELETE `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
*/
guildSoundboardSound(guildId: Snowflake, soundId: Snowflake) {
return `/guilds/${guildId}/soundboard-sounds/${soundId}` as const;
},
};
export const StickerPackApplicationId = '710982414301790216';
@@ -1313,6 +1349,14 @@ export const CDNRoutes = {
) {
return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const;
},
/**
* Route for:
* - GET `/soundboard-sounds/${sound.id}`
*/
soundboardSound(soundId: Snowflake) {
return `/soundboard-sounds/${soundId}` as const;
},
};
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;

107
rest/v9/soundboard.ts Normal file
View File

@@ -0,0 +1,107 @@
import type { Snowflake } from '../../globals';
import type { APISoundboardSound } from '../../payloads/v10/index';
/**
* https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound
*/
export type RESTPostAPISendSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound-json-params
*/
export interface RESTPostAPISoundboardSendSoundJSONBody {
/**
* The id of the soundboard sound to play
*/
sound_id: Snowflake;
/**
* The id of the guild the soundboard sound is from, required to play sounds from different servers
*/
source_guild_id?: Snowflake | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#list-soundboard-default-sounds
*/
export type RESTGetAPISoundboardDefaultSoundsResult = APISoundboardSound[];
/**
* https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds
*/
export interface RESTGetAPIGuildSoundboardSoundsResult {
items: APISoundboardSound[];
}
/**
* https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound
*/
export type RESTGetAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound-json-params
*/
export interface RESTPostAPIGuildSoundboardSoundJSONBody {
/**
* The name of the soundboard sound (2-32 characters)
*/
name: string;
/**
* The data uri of the mp3 or ogg sound data, base64 encoded, similar to image data
*
* See https://discord.com/developers/docs/reference#image-data
*/
sound: string;
/**
* The volume of the soundboard sound, from 0 to 1
*
* @default 1
*/
volume?: number | null | undefined;
/**
* The id of the custom emoji for the soundboard sound
*/
emoji_id?: Snowflake | null | undefined;
/**
* The unicode character of a standard emoji for the soundboard sound
*/
emoji_name?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound
*/
export type RESTPostAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound-json-params
*/
export interface RESTPatchAPIGuildSoundboardSoundJSONBody {
/**
* The name of the soundboard sound (2-32 characters)
*/
name?: string | undefined;
/**
* The volume of the soundboard sound, from 0 to 1
*
* @default 1
*/
volume?: number | null | undefined;
/**
* The id of the custom emoji for the soundboard sound
*/
emoji_id?: Snowflake | null | undefined;
/**
* The unicode character of a standard emoji for the soundboard sound
*/
emoji_name?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound
*/
export type RESTPatchAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound
*/
export type RESTDeleteAPIGuildSoundboardSoundResult = never;