Refactor models and add IHasId/IdBasedEqualityComparer

This commit is contained in:
Alexey Golub
2019-12-06 00:17:14 +02:00
parent 23512dae64
commit fc38afe6a0
10 changed files with 34 additions and 12 deletions

View File

@@ -2,13 +2,13 @@
{
// https://discordapp.com/developers/docs/resources/channel#channel-object
public partial class Channel
public partial class Channel : IHasId
{
public string Id { get; }
public string? ParentId { get; }
public string? GuildId { get; }
public string GuildId { get; }
public string Name { get; }
@@ -16,7 +16,7 @@
public ChannelType Type { get; }
public Channel(string id, string? parentId, string? guildId, string name, string? topic, ChannelType type)
public Channel(string id, string? parentId, string guildId, string name, string? topic, ChannelType type)
{
Id = id;
ParentId = parentId;
@@ -32,6 +32,6 @@
public partial class Channel
{
public static Channel CreateDeletedChannel(string id) =>
new Channel(id, null, null, "deleted-channel", null, ChannelType.GuildTextChat);
new Channel(id, null, "unknown-guild", "deleted-channel", null, ChannelType.GuildTextChat);
}
}