Method CreateEmojiAsync
- Namespace
- DSharpPlus.Entities
- Assembly
- DSharpPlus.dll
CreateEmojiAsync(string, Stream, IEnumerable<DiscordRole>?, string?)
Creates a new custom emoji for this guild.
public Task<DiscordGuildEmoji> CreateEmojiAsync(string name, Stream image, IEnumerable<DiscordRole>? roles = null, string? reason = null)
Parameters
name
stringName of the new emoji.
image
StreamImage to use as the emoji.
roles
IEnumerable<DiscordRole>Roles for which the emoji will be available. This works only if your application is whitelisted as integration.
reason
stringReason for audit log.
Returns
- Task<DiscordGuildEmoji>
The newly-created emoji.
Exceptions
- UnauthorizedException
Thrown when the client does not have the ManageGuildExpressions permission.
- ServerErrorException
Thrown when Discord is unable to process the request.