Browse Source

Changed snowflakes to be wrapped in an optional instead of a nullable.

pull/1413/head
Neuheit 5 years ago
parent
commit
d2c7d0aa82
2 changed files with 6 additions and 6 deletions
  1. +4
    -4
      src/Discord.Net.Core/Entities/Messages/MessageReference.cs
  2. +2
    -2
      src/Discord.Net.Rest/API/Common/MessageReference.cs

+ 4
- 4
src/Discord.Net.Core/Entities/Messages/MessageReference.cs View File

@@ -11,7 +11,7 @@ namespace Discord
/// <summary>
/// Gets the Message ID of the original message.
/// </summary>
public ulong? MessageId { get; internal set; }
public Optional<ulong> MessageId { get; internal set; }

/// <summary>
/// Gets the Channel ID of the original message.
@@ -21,11 +21,11 @@ namespace Discord
/// <summary>
/// Gets the Guild ID of the original message.
/// </summary>
public ulong? GuildId { get; internal set; }
public Optional<ulong> GuildId { get; internal set; }

private string DebuggerDisplay
=> $"Channel ID: ({ChannelId}){(GuildId.HasValue ? $", Guild ID: ({GuildId.Value})" : "")}" +
$"{(MessageId.HasValue ? $", Message ID: ({MessageId.Value})" : "")}";
=> $"Channel ID: ({ChannelId}){(GuildId.IsSpecified ? $", Guild ID: ({GuildId.Value})" : "")}" +
$"{(MessageId.IsSpecified ? $", Message ID: ({MessageId.Value})" : "")}";

public override string ToString()
=> DebuggerDisplay;


+ 2
- 2
src/Discord.Net.Rest/API/Common/MessageReference.cs View File

@@ -5,12 +5,12 @@ namespace Discord.API
internal class MessageReference
{
[JsonProperty("message_id")]
public ulong? MessageId { get; set; }
public Optional<ulong> MessageId { get; set; }

[JsonProperty("channel_id")]
public ulong ChannelId { get; set; }

[JsonProperty("guild_id")]
public ulong? GuildId { get; set; }
public Optional<ulong> GuildId { get; set; }
}
}

Loading…
Cancel
Save