Show / Hide Table of Contents

# Class SocketRole

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

##### Inheritance

System.Object
SocketEntity<System.UInt64>
SocketRole

##### Implements

IRole
ISnowflakeEntity
IEntity<System.UInt64>
IDeletable
IMentionable
System.IComparable<IRole>

##### Inherited Members

SocketEntity<UInt64>.Id
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()

###### Namespace: Discord.WebSocket

###### Assembly: Discord.Net.WebSocket.dll

##### Syntax

    public class SocketRole : SocketEntity<ulong>, IRole, ISnowflakeEntity, IEntity<ulong>, IDeletable, IMentionable, IComparable<IRole>

### Properties

| Improve this Doc View Source

#### Color

##### Declaration

    public Color Color { get; }

##### Property Value

Type | Description
--- | ---
Color |

| Improve this Doc View Source

#### CreatedAt

##### Declaration

    public DateTimeOffset CreatedAt { get; }

##### Property Value

Type | Description
--- | ---
System.DateTimeOffset |

| Improve this Doc View Source

#### Guild

Gets the guild that owns this role.

##### Declaration

    public SocketGuild Guild { get; }

##### Property Value

Type | Description
--- | ---
SocketGuild | A SocketGuild representing the parent guild of this role.

| Improve this Doc View Source

#### IsEveryone

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

##### Declaration

    public bool IsEveryone { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean | `true` if the role is @everyone; otherwise `false`.

| Improve this Doc View Source

#### IsHoisted

##### Declaration

    public bool IsHoisted { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### IsManaged

##### Declaration

    public bool IsManaged { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### IsMentionable

##### Declaration

    public bool IsMentionable { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### Members

##### Declaration

    public IEnumerable<SocketGuildUser> Members { get; }

##### Property Value

Type | Description
--- | ---
System.Collections.Generic.IEnumerable<SocketGuildUser> |

| Improve this Doc View Source

#### Mention

##### Declaration

    public string Mention { get; }

##### Property Value

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### Name

##### Declaration

    public string Name { get; }

##### Property Value

Type | Description
--- | ---
System.String |

| Improve this Doc View Source

#### Permissions

##### Declaration

    public GuildPermissions Permissions { get; }

##### Property Value

Type | Description
--- | ---
GuildPermissions |

| Improve this Doc View Source

#### Position

##### Declaration

    public int Position { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

### Methods

| Improve this Doc View Source

#### CompareTo(IRole)

##### Declaration

    public int CompareTo(IRole role)

##### Parameters

Type | Name | Description
--- | --- | ---
IRole | role |

##### Returns

Type | Description
--- | ---
System.Int32 |

| Improve this Doc View Source

#### DeleteAsync(RequestOptions)

##### Declaration

    public Task DeleteAsync(RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task |

| Improve this Doc View Source

#### ModifyAsync(Action<RoleProperties>, RequestOptions)

##### Declaration

    public Task ModifyAsync(Action<RoleProperties> func, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Action<RoleProperties> | func |
RequestOptions | options |

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task |

| Improve this Doc View Source

#### ToString()

Gets the name of the role.

##### Declaration

    public override string ToString()

##### Returns

Type | Description
--- | ---
System.String | A string that resolves to Name.

##### Overrides

System.Object.ToString()

### Explicit Interface Implementations

| Improve this Doc View Source

#### IRole.Guild

##### Declaration

    IGuild IRole.Guild { get; }

##### Returns

Type | Description
--- | ---
IGuild |

### Implements

IRole
ISnowflakeEntity
IEntity<TId>
IDeletable
IMentionable
System.IComparable<T>