Browse Source

Added RestRole documentation

pull/1161/head
Casino Boyale 7 years ago
parent
commit
09cd5b8ded
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      src/Discord.Net.Rest/Entities/Roles/RestRole.cs

+ 9
- 0
src/Discord.Net.Rest/Entities/Roles/RestRole.cs View File

@@ -26,6 +26,9 @@ namespace Discord.Rest

/// <inheritdoc />
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);
/// <summary>
/// Gets if this role is the @everyone role of the guild or not.
/// </summary>
public bool IsEveryone => Id == Guild.Id;
/// <inheritdoc />
public string Mention => IsEveryone ? "@everyone" : MentionUtils.MentionRole(Id);
@@ -65,6 +68,12 @@ namespace Discord.Rest
/// <inheritdoc />
public int CompareTo(IRole role) => RoleUtils.Compare(this, role);

/// <summary>
/// Gets the name of the role.
/// </summary>
/// <returns>
/// A string that is the name of the role.
/// </returns>
public override string ToString() => Name;
private string DebuggerDisplay => $"{Name} ({Id})";



Loading…
Cancel
Save