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
stringThe name of the sound.
sound
StreamThe 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
stringThe name of the emoji associated with the sound. Optional.
reason
stringThe 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.