feat: add soundboard (#10536)

* feat: add soundboard

* chore: disable `jsdoc/check-param-names` rule

* fix: export `SoundboardSoundsAPI`
This commit is contained in:
Danial Raza
2024-11-04 11:03:13 +01:00
committed by Jiralite
parent 2deea25e97
commit d25ef434ae
5 changed files with 149 additions and 0 deletions

View File

@@ -34,6 +34,8 @@ import {
type RESTPutAPIChannelPermissionJSONBody,
type RESTPutAPIChannelRecipientJSONBody,
type Snowflake,
type RESTPostAPISoundboardSendSoundJSONBody,
type RESTPostAPISendSoundboardSoundResult,
} from 'discord-api-types/v10';
export interface StartForumThreadOptions extends RESTPostAPIGuildForumThreadsJSONBody {
@@ -595,6 +597,25 @@ export class ChannelsAPI {
});
}
/**
* Sends a soundboard sound in a channel
*
* @see {@link https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound}
* @param channelId - The id of the channel to send the soundboard sound in
* @param body - The data for sending the soundboard sound
* @param options - The options for sending the soundboard sound
*/
public async sendSoundboardSound(
channelId: Snowflake,
body: RESTPostAPISoundboardSendSoundJSONBody,
{ signal }: Pick<RequestData, 'signal'> = {},
) {
return this.rest.post(Routes.sendSoundboardSound(channelId), {
body,
signal,
}) as Promise<RESTPostAPISendSoundboardSoundResult>;
}
/**
* Adds a recipient to a group DM channel
*