Class RestRole
Represents a REST-based role.
Assembly: Discord.Net.Rest.dll​
View Source​
public class RestRole : RestEntity<ulong>, IRole, ISnowflakeEntity, IEntity<ulong>, IDeletable, IMentionable, IComparable<IRole>
Properties​
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; }
Icon​
Gets the icon of this role.
View Source​
public string Icon { get; }
Emoji​
View Source​
public Emoji Emoji { 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​
Gets if this role is the @everyone role of the guild or not.
View Source​
public bool IsEveryone { get; }
Mention​
Returns a special string used to mention this object.
View Source​
public string Mention { 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 async 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.
CompareTo(IRole)​
View Source​
public int CompareTo(IRole role)
Returns​
System.Int32
Parameters​
Type | Name |
---|---|
Discord.IRole | role |
ToString()​
Gets the name of the role.
View Source​
public override string ToString()
Returns​
System.String
:
A string that is the name of the role.
Implements​
- Discord.IRole
- Discord.ISnowflakeEntity
- Discord.IEntity<TId>
- Discord.IDeletable
- Discord.IMentionable
System.IComparable<Discord.IRole>