Browse Source

Added DebuggerDisplay/ToString to Emoji and GuildEmbed

tags/1.0-rc
RogueException 8 years ago
parent
commit
eff995a2a6
2 changed files with 11 additions and 1 deletions
  1. +5
    -0
      src/Discord.Net/Entities/Guilds/Emoji.cs
  2. +6
    -1
      src/Discord.Net/Entities/Guilds/GuildEmbed.cs

+ 5
- 0
src/Discord.Net/Entities/Guilds/Emoji.cs View File

@@ -1,8 +1,10 @@
using System.Collections.Immutable;
using System.Diagnostics;
using Model = Discord.API.Emoji;

namespace Discord
{
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public struct Emoji
{
public ulong Id { get; }
@@ -19,5 +21,8 @@ namespace Discord
RequireColons = model.RequireColons;
RoleIds = ImmutableArray.Create(model.Roles);
}

public override string ToString() => Name;
private string DebuggerDisplay => $"{Name} ({Id})";
}
}

+ 6
- 1
src/Discord.Net/Entities/Guilds/GuildEmbed.cs View File

@@ -1,7 +1,9 @@
using Model = Discord.API.GuildEmbed;
using System.Diagnostics;
using Model = Discord.API.GuildEmbed;

namespace Discord
{
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public struct GuildEmbed
{
public bool IsEnabled { get; private set; }
@@ -14,5 +16,8 @@ namespace Discord
}
internal GuildEmbed(Model model)
: this(model.Enabled, model.ChannelId) { }

public override string ToString() => ChannelId?.ToString();
private string DebuggerDisplay => $"{ChannelId} ({(IsEnabled ? "Enabled" : "Disabled")})";
}
}

Loading…
Cancel
Save