Table of Contents

Class Role

Namespace
NetCord
Assembly
NetCord.dll
public class Role : ClientEntity, IEntity, ISpanFormattable, IFormattable, IEquatable<Entity>, IJsonModel<JsonRole>
Inheritance
Role
Implements
Inherited Members

Constructors

Role(JsonRole, ulong, RestClient)

public Role(JsonRole jsonModel, ulong guildId, RestClient client)

Parameters

jsonModel JsonRole
guildId ulong
client RestClient

Properties

Color

public Color Color { get; }

Property Value

Color

Flags

public RoleFlags Flags { get; }

Property Value

RoleFlags

GuildId

public ulong GuildId { get; }

Property Value

ulong

Hoist

public bool Hoist { get; }

Property Value

bool

IconHash

public string? IconHash { get; }

Property Value

string

Id

The unique identifier for this object.

public override ulong Id { get; }

Property Value

ulong

Managed

public bool Managed { get; }

Property Value

bool

Mentionable

public bool Mentionable { get; }

Property Value

bool

Name

public string Name { get; }

Property Value

string

Permissions

public Permissions Permissions { get; }

Property Value

Permissions

Position

public RolePosition Position { get; }

Property Value

RolePosition

RawPosition

public int RawPosition { get; }

Property Value

int

Tags

public RoleTags? Tags { get; }

Property Value

RoleTags

UnicodeEmoji

public string? UnicodeEmoji { get; }

Property Value

string

Methods

DeleteAsync(RestRequestProperties?, CancellationToken)

public Task DeleteAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

GetIconUrl(ImageFormat)

public ImageUrl? GetIconUrl(ImageFormat format)

Parameters

format ImageFormat

Returns

ImageUrl

ModifyAsync(Action<RoleOptions>, RestRequestProperties?, CancellationToken)

public Task<Role> ModifyAsync(Action<RoleOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

action Action<RoleOptions>
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task<Role>

ToString()

public override string ToString()

Returns

string

TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)

public override bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = null)

Parameters

destination Span<char>
charsWritten int
format ReadOnlySpan<char>
provider IFormatProvider

Returns

bool