Table of Contents

Class Role

Namespace
NetCord
Assembly
NetCord.dll
public class Role : ClientEntity, IEntity, ISpanFormattable, IFormattable, IEquatable<Entity>, IJsonModel<JsonRole>, IComparable<Role>
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 int Position { get; }

Property Value

int

Tags

public RoleTags? Tags { get; }

Property Value

RoleTags

UnicodeEmoji

public string? UnicodeEmoji { get; }

Property Value

string

Methods

CompareTo(Role?)

public int CompareTo(Role? other)

Parameters

other Role

Returns

int

DeleteAsync(ulong, RestRequestProperties?, CancellationToken)

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

Parameters

roleId ulong
properties RestRequestProperties
cancellationToken CancellationToken

Returns

Task

GetIconUrl(ImageFormat)

public ImageUrl? GetIconUrl(ImageFormat format)

Parameters

format ImageFormat

Returns

ImageUrl

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

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

Parameters

roleId ulong
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

Operators

operator >(Role, Role)

public static bool operator >(Role left, Role right)

Parameters

left Role
right Role

Returns

bool

operator >=(Role, Role)

public static bool operator >=(Role left, Role right)

Parameters

left Role
right Role

Returns

bool

operator <(Role, Role)

public static bool operator <(Role left, Role right)

Parameters

left Role
right Role

Returns

bool

operator <=(Role, Role)

public static bool operator <=(Role left, Role right)

Parameters

left Role
right Role

Returns

bool