From 8ccc163fcddc5b2b911c24f7470552a9e770fa9c Mon Sep 17 00:00:00 2001 From: Ge Date: Fri, 31 Mar 2023 19:19:09 +0800 Subject: [PATCH] Missing DebuggerDisplay attribute or property (#2630) --- src/Discord.Net.Commands/Results/MatchResult.cs | 2 ++ src/Discord.Net.Rest/Entities/Channels/RestNewsChannel.cs | 2 ++ .../Entities/Channels/SocketNewsChannel.cs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/Discord.Net.Commands/Results/MatchResult.cs b/src/Discord.Net.Commands/Results/MatchResult.cs index 45492f26..56d61387 100644 --- a/src/Discord.Net.Commands/Results/MatchResult.cs +++ b/src/Discord.Net.Commands/Results/MatchResult.cs @@ -1,7 +1,9 @@ using System; +using System.Diagnostics; namespace Discord.Commands { + [DebuggerDisplay(@"{DebuggerDisplay,nq}")] public class MatchResult : IResult { /// diff --git a/src/Discord.Net.Rest/Entities/Channels/RestNewsChannel.cs b/src/Discord.Net.Rest/Entities/Channels/RestNewsChannel.cs index 1d71abe1..3c73a4c1 100644 --- a/src/Discord.Net.Rest/Entities/Channels/RestNewsChannel.cs +++ b/src/Discord.Net.Rest/Entities/Channels/RestNewsChannel.cs @@ -27,6 +27,8 @@ namespace Discord.Rest } public override int SlowModeInterval => throw new NotSupportedException("News channels do not support Slow Mode."); + private string DebuggerDisplay => $"{Name} ({Id}, News)"; + /// public Task FollowAnnouncementChannelAsync(ulong channelId, RequestOptions options = null) => ChannelHelper.FollowAnnouncementChannelAsync(this, channelId, Discord, options); diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketNewsChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketNewsChannel.cs index 415792de..ec3a0b94 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketNewsChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketNewsChannel.cs @@ -37,6 +37,8 @@ namespace Discord.WebSocket public override int SlowModeInterval => throw new NotSupportedException("News channels do not support Slow Mode."); + private string DebuggerDisplay => $"{Name} ({Id}, News)"; + /// public Task FollowAnnouncementChannelAsync(ITextChannel channel, RequestOptions options = null) => FollowAnnouncementChannelAsync(channel.Id, options);