From 05a0b9c60a9847c13fc9108d4f2d4ec75bbfe667 Mon Sep 17 00:00:00 2001 From: Danial Raza Date: Thu, 10 Sep 2026 12:16:17 +0200 Subject: [PATCH] types(GuildSoundboardSoundManager): nullable emoji and volume --- .../src/managers/GuildSoundboardSoundManager.js | 6 +++--- packages/discord.js/typings/index.d.ts | 6 +++--- packages/discord.js/typings/index.test-d.ts | 8 ++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/discord.js/src/managers/GuildSoundboardSoundManager.js b/packages/discord.js/src/managers/GuildSoundboardSoundManager.js index c5027c0fb..cd386c886 100644 --- a/packages/discord.js/src/managers/GuildSoundboardSoundManager.js +++ b/packages/discord.js/src/managers/GuildSoundboardSoundManager.js @@ -75,9 +75,9 @@ class GuildSoundboardSoundManager extends CachedManager { * @property {BufferResolvable|Stream} file The file for the soundboard sound * @property {string} name The name for the soundboard sound * @property {string} [contentType] The content type for the soundboard sound file - * @property {number} [volume] The volume (a double) for the soundboard sound, from 0 (inclusive) to 1. Defaults to 1 - * @property {Snowflake} [emojiId] The emoji id for the soundboard sound - * @property {string} [emojiName] The emoji name for the soundboard sound + * @property {?number} [volume] The volume (a double) for the soundboard sound, from 0 (inclusive) to 1. Defaults to 1 + * @property {?Snowflake} [emojiId] The emoji id for the soundboard sound + * @property {?string} [emojiName] The emoji name for the soundboard sound * @property {string} [reason] The reason for creating the soundboard sound */ diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 8847caa38..e693f6625 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -4625,12 +4625,12 @@ export class GuildScheduledEventManager extends CachedManager< export interface GuildSoundboardSoundCreateOptions { contentType?: string; - emojiId?: Snowflake; - emojiName?: string; + emojiId?: Snowflake | null; + emojiName?: string | null; file: BufferResolvable | Stream; name: string; reason?: string; - volume?: number; + volume?: number | null; } export interface GuildSoundboardSoundEditOptions { diff --git a/packages/discord.js/typings/index.test-d.ts b/packages/discord.js/typings/index.test-d.ts index a0cfd48bd..2c532d893 100644 --- a/packages/discord.js/typings/index.test-d.ts +++ b/packages/discord.js/typings/index.test-d.ts @@ -833,6 +833,14 @@ declare const slashCommandBuilder: ChatInputCommandBuilder; declare const contextMenuCommandBuilder: ContextMenuCommandBuilder; declare const guild: Guild; +await guild.soundboardSounds.create({ + file: './sound.mp3', + name: 'sound', + emojiId: null, + emojiName: null, + volume: null, +}); + client.on('clientReady', async client => { expectType>(client); console.log(`Client is logged in as ${client.user.tag} and ready!`);