Table of Contents

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 string

Name of the new emoji.

image Stream

Image 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 string

Reason 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.