Class SocketRole
Represents a WebSocket-based role to be given to a guild user.
Assembly: Discord.Net.WebSocket.dll​
View Source​
public class SocketRole : SocketEntity<ulong>, IRole, ISnowflakeEntity, IEntity<ulong>, IDeletable, IMentionable, IComparable<IRole>
Properties​
Guild​
Gets the guild that owns this role.
View Source​
public SocketGuild Guild { get; }
Color​
Gets the color given to users of this role.
View Source​
public Color Color { get; }
IsHoisted​
Gets a value that indicates whether the role can be separated in the user list.
View Source​
public bool IsHoisted { get; }
IsManaged​
Gets a value that indicates whether the role is managed by Discord.
View Source​
public bool IsManaged { get; }
IsMentionable​
Gets a value that indicates whether the role is mentionable.
View Source​
public bool IsMentionable { get; }
Name​
Gets the name of this role.
View Source​
public string Name { get; }
Emoji​
Gets the unicode emoji of this role.
View Source​
public Emoji Emoji { get; }
Icon​
Gets the icon of this role.
View Source​
public string Icon { get; }
Permissions​
Gets the permissions granted to members of this role.
View Source​
public GuildPermissions Permissions { get; }
Position​
Gets this role's position relative to other roles in the same guild.
View Source​
public int Position { get; }
Tags​
Gets the tags related to this role.
View Source​
public RoleTags Tags { get; }
CreatedAt​
Gets when the snowflake was created.
View Source​
public DateTimeOffset CreatedAt { get; }
IsEveryone​
Returns a value that determines if the role is an @everyone role.
View Source​
public bool IsEveryone { get; }
Mention​
Returns a special string used to mention this object.
View Source​
public string Mention { get; }
Members​
Returns an IEnumerable containing all Discord.WebSocket.SocketGuildUser that have this role.
View Source​
public IEnumerable<SocketGuildUser> Members { get; }
IRole.Guild​
Gets the guild that owns this role.
View Source​
IGuild IRole.Guild { get; }
Methods​
ModifyAsync(Action<RoleProperties>, RequestOptions)​
Modifies this role.
View Source​
public Task ModifyAsync(Action<RoleProperties> func, RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
:
A task that represents the asynchronous modification operation.
Parameters​
Type | Name | Description |
---|---|---|
System.Action<Discord.RoleProperties> | func | A delegate containing the properties to modify the role with. |
Discord.RequestOptions | options | The options to be used when sending the request. |
DeleteAsync(RequestOptions)​
Deletes this object and all its children.
View Source​
public Task DeleteAsync(RequestOptions options = null)
Returns​
System.Threading.Tasks.Task
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The options to be used when sending the request. |
GetIconUrl()​
Gets the image url of the icon role.
View Source​
public string GetIconUrl()
Returns​
System.String
:
An image url of the icon role.
ToString()​
Gets the name of the role.
View Source​
public override string ToString()
Returns​
System.String
:
A string that resolves to Discord.WebSocket.SocketRole.Name.
CompareTo(IRole)​
View Source​
public int CompareTo(IRole role)
Returns​
System.Int32
Parameters​
Type | Name |
---|---|
Discord.IRole | role |
Implements​
- Discord.IRole
- Discord.ISnowflakeEntity
- Discord.IEntity<TId>
- Discord.IDeletable
- Discord.IMentionable
System.IComparable<Discord.IRole>