Skip to main content

Class SocketRole

Represents a WebSocket-based role to be given to a guild user.

Assembly: Discord.Net.WebSocket.dll​
View Source​
Declaration
public class SocketRole : SocketEntity<ulong>, IRole, ISnowflakeEntity, IEntity<ulong>, IDeletable, IMentionable, IComparable<IRole>

Properties​

Guild​

Gets the guild that owns this role.

View Source​
Declaration
public SocketGuild Guild { get; }

Color​

Gets the color given to users of this role.

View Source​
Declaration
public Color Color { get; }

IsHoisted​

Gets a value that indicates whether the role can be separated in the user list.

View Source​
Declaration
public bool IsHoisted { get; }

IsManaged​

Gets a value that indicates whether the role is managed by Discord.

View Source​
Declaration
public bool IsManaged { get; }

IsMentionable​

Gets a value that indicates whether the role is mentionable.

View Source​
Declaration
public bool IsMentionable { get; }

Name​

Gets the name of this role.

View Source​
Declaration
public string Name { get; }

Emoji​

Gets the unicode emoji of this role.

View Source​
Declaration
public Emoji Emoji { get; }

Icon​

Gets the icon of this role.

View Source​
Declaration
public string Icon { get; }

Permissions​

Gets the permissions granted to members of this role.

View Source​
Declaration
public GuildPermissions Permissions { get; }

Position​

Gets this role's position relative to other roles in the same guild.

View Source​
Declaration
public int Position { get; }

Tags​

Gets the tags related to this role.

View Source​
Declaration
public RoleTags Tags { get; }

CreatedAt​

Gets when the snowflake was created.

View Source​
Declaration
public DateTimeOffset CreatedAt { get; }

IsEveryone​

Returns a value that determines if the role is an @everyone role.

View Source​
Declaration
public bool IsEveryone { get; }

Mention​

Returns a special string used to mention this object.

View Source​
Declaration
public string Mention { get; }

Members​

Returns an IEnumerable containing all Discord.WebSocket.SocketGuildUser that have this role.

View Source​
Declaration
public IEnumerable<SocketGuildUser> Members { get; }

IRole.Guild​

Gets the guild that owns this role.

View Source​
Declaration
IGuild IRole.Guild { get; }

Methods​

ModifyAsync(Action<RoleProperties>, RequestOptions)​

Modifies this role.

View Source​
Declaration
public Task ModifyAsync(Action<RoleProperties> func, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous modification operation.

Parameters​
TypeNameDescription
System.Action<Discord.RoleProperties>funcA delegate containing the properties to modify the role with.
Discord.RequestOptionsoptionsThe options to be used when sending the request.

DeleteAsync(RequestOptions)​

Deletes this object and all its children.

View Source​
Declaration
public Task DeleteAsync(RequestOptions options = null)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe options to be used when sending the request.

GetIconUrl()​

Gets the image url of the icon role.

View Source​
Declaration
public string GetIconUrl()
Returns​

System.String: An image url of the icon role.

ToString()​

Gets the name of the role.

View Source​
Declaration
public override string ToString()
Returns​

System.String: A string that resolves to Discord.WebSocket.SocketRole.Name.

CompareTo(IRole)​

View Source​
Declaration
public int CompareTo(IRole role)
Returns​

System.Int32

Parameters​
TypeName
Discord.IRolerole

Implements​