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