@@ -102,6 +102,12 @@ import {
102102 type RESTPutAPIGuildOnboardingJSONBody ,
103103 type RESTPutAPIGuildOnboardingResult ,
104104 type RESTPutAPIGuildTemplateSyncResult ,
105+ type RESTGetAPIGuildSoundboardSoundResult ,
106+ type RESTGetAPIGuildSoundboardSoundsResult ,
107+ type RESTPatchAPIGuildSoundboardSoundJSONBody ,
108+ type RESTPatchAPIGuildSoundboardSoundResult ,
109+ type RESTPostAPIGuildSoundboardSoundJSONBody ,
110+ type RESTPostAPIGuildSoundboardSoundResult ,
105111 type Snowflake ,
106112} from 'discord-api-types/v10' ;
107113import { VoiceAPI } from './voice' ;
@@ -1362,6 +1368,95 @@ export class GuildsAPI {
13621368 } ) as Promise < RESTPutAPIGuildOnboardingResult > ;
13631369 }
13641370
1371+ /**
1372+ * Fetches all the soundboard sounds for a guild
1373+ *
1374+ * @see {@link https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds }
1375+ * @param guildId - The id of the guild to fetch the soundboard sounds for
1376+ * @param options - The options for fetching the soundboard sounds
1377+ */
1378+ public async getSoundboardSounds ( guildId : Snowflake , { signal } : Pick < RequestData , 'signal' > = { } ) {
1379+ return this . rest . get ( Routes . guildSoundboardSounds ( guildId ) , {
1380+ signal,
1381+ } ) as Promise < RESTGetAPIGuildSoundboardSoundsResult > ;
1382+ }
1383+
1384+ /**
1385+ * Fetches a soundboard sound for a guild
1386+ *
1387+ * @see {@link https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound }
1388+ * @param guildId - The id of the guild to fetch the soundboard sound for
1389+ * @param soundId - The id of the soundboard sound to fetch
1390+ * @param options - The options for fetching the soundboard sound
1391+ */
1392+ public async getSoundboardSound (
1393+ guildId : Snowflake ,
1394+ soundId : Snowflake ,
1395+ { signal } : Pick < RequestData , 'signal' > = { } ,
1396+ ) {
1397+ return this . rest . get ( Routes . guildSoundboardSound ( guildId , soundId ) , {
1398+ signal,
1399+ } ) as Promise < RESTGetAPIGuildSoundboardSoundResult > ;
1400+ }
1401+
1402+ /**
1403+ * Creates a new soundboard sound for a guild
1404+ *
1405+ * @see {@link https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound }
1406+ * @param guildId - The id of the guild to create the soundboard sound for
1407+ * @param body - The data for creating the soundboard sound
1408+ * @param options - The options for creating the soundboard sound
1409+ */
1410+ public async createSoundboardSound (
1411+ guildId : Snowflake ,
1412+ body : RESTPostAPIGuildSoundboardSoundJSONBody ,
1413+ { reason, signal } : Pick < RequestData , 'reason' | 'signal' > = { } ,
1414+ ) {
1415+ return this . rest . post ( Routes . guildSoundboardSounds ( guildId ) , {
1416+ body,
1417+ reason,
1418+ signal,
1419+ } ) as Promise < RESTPostAPIGuildSoundboardSoundResult > ;
1420+ }
1421+
1422+ /**
1423+ * Edits a soundboard sound for a guild
1424+ *
1425+ * @see {@link https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound }
1426+ * @param guildId - The id of the guild to edit the soundboard sound for
1427+ * @param soundId - The id of the soundboard sound to edit
1428+ * @param body - The data for editing the soundboard sound
1429+ * @param options - The options for editing the soundboard sound
1430+ */
1431+ public async editSoundboardSound (
1432+ guildId : Snowflake ,
1433+ soundId : Snowflake ,
1434+ body : RESTPatchAPIGuildSoundboardSoundJSONBody ,
1435+ { reason, signal } : Pick < RequestData , 'reason' | 'signal' > = { } ,
1436+ ) {
1437+ return this . rest . patch ( Routes . guildSoundboardSound ( guildId , soundId ) , {
1438+ body,
1439+ reason,
1440+ signal,
1441+ } ) as Promise < RESTPatchAPIGuildSoundboardSoundResult > ;
1442+ }
1443+
1444+ /**
1445+ * Deletes a soundboard sound for a guild
1446+ *
1447+ * @see {@link https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound }
1448+ * @param guildId - The id of the guild to delete the soundboard sound for
1449+ * @param soundId - The id of the soundboard sound to delete
1450+ * @param options - The options for deleting the soundboard sound
1451+ */
1452+ public async deleteSoundboardSound (
1453+ guildId : Snowflake ,
1454+ soundId : Snowflake ,
1455+ { reason, signal } : Pick < RequestData , 'reason' | 'signal' > = { } ,
1456+ ) {
1457+ await this . rest . delete ( Routes . guildSoundboardSound ( guildId , soundId ) , { reason, signal } ) ;
1458+ }
1459+
13651460 /**
13661461 * Modifies incident actions for a guild.
13671462 *
0 commit comments