mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
feat: add soundboard (#10536)
* feat: add soundboard * chore: disable `jsdoc/check-param-names` rule * fix: export `SoundboardSoundsAPI`
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user