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
namestringThe name of the sound.
soundStreamThe sound file stream. Can be MP3 or OGG, and must be base64 encoded.
volumedouble?The volume of the sound. Optional.
emojiIdulong?The ID of the emoji associated with the sound. Optional.
emojiNamestringThe name of the emoji associated with the sound. Optional.
reasonstringThe 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.