Table of Contents

Method CreateSoundboardSoundAsync

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

CreateSoundboardSoundAsync(string, Stream, double?, ulong?, string?, string?)

Creates a new soundboard sound in the guild.

public Task<DiscordSoundboardSound> CreateSoundboardSoundAsync(string name, Stream sound, double? volume = null, ulong? emojiId = null, string? emojiName = null, string? reason = null)

Parameters

name string

The name of the sound.

sound Stream

The sound file stream. Can be MP3 or OGG, and must be base64 encoded.

volume double?

The volume of the sound. Optional.

emojiId ulong?

The ID of the emoji associated with the sound. Optional.

emojiName string

The name of the emoji associated with the sound. Optional.

reason string

The reason for creating the sound, to be logged in the audit log. Optional.

Returns

Task<DiscordSoundboardSound>

The created DiscordSoundboardSound.

Exceptions

UnauthorizedException

Thrown when the client does not have the CreateGuildExpressions permission.

ServerErrorException

Thrown when Discord is unable to process the request.