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 GitHub
parent ed78e45706
commit a9f629b0d3
5 changed files with 149 additions and 0 deletions

View File

@@ -33,6 +33,8 @@ import {
type RESTPostAPIChannelThreadsResult,
type APIThreadChannel,
type RESTPostAPIGuildForumThreadsJSONBody,
type RESTPostAPISoundboardSendSoundJSONBody,
type RESTPostAPISendSoundboardSoundResult,
} from 'discord-api-types/v10';
export interface StartForumThreadOptions extends RESTPostAPIGuildForumThreadsJSONBody {
@@ -583,4 +585,23 @@ export class ChannelsAPI {
signal,
});
}
/**
* 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>;
}
}