Replaced several arrays with immutables
This commit is contained in:
@@ -15,11 +15,11 @@ namespace Discord.Rest
|
||||
public IReadOnlyCollection<Overwrite> PermissionOverwrites => _overwrites;
|
||||
|
||||
internal IGuild Guild { get; }
|
||||
public ulong GuildId => Guild.Id;
|
||||
|
||||
public string Name { get; private set; }
|
||||
public int Position { get; private set; }
|
||||
|
||||
public ulong GuildId => Guild.Id;
|
||||
|
||||
internal RestGuildChannel(BaseDiscordClient discord, IGuild guild, ulong id)
|
||||
: base(discord, id)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,6 @@ namespace Discord.Rest
|
||||
public bool IsSyncing { get; private set; }
|
||||
public ulong ExpireBehavior { get; private set; }
|
||||
public ulong ExpireGracePeriod { get; private set; }
|
||||
|
||||
public ulong GuildId { get; private set; }
|
||||
public ulong RoleId { get; private set; }
|
||||
public RestUser User { get; private set; }
|
||||
|
||||
@@ -9,7 +9,6 @@ namespace Discord.Rest
|
||||
{
|
||||
public string ChannelName { get; private set; }
|
||||
public string GuildName { get; private set; }
|
||||
|
||||
public ulong ChannelId { get; private set; }
|
||||
public ulong GuildId { get; private set; }
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ namespace Discord.Rest
|
||||
public virtual bool IsPinned => false;
|
||||
public virtual bool IsWebhook => false;
|
||||
public virtual DateTimeOffset? EditedTimestamp => null;
|
||||
|
||||
public virtual IReadOnlyCollection<IAttachment> Attachments => ImmutableArray.Create<IAttachment>();
|
||||
public virtual IReadOnlyCollection<IEmbed> Embeds => ImmutableArray.Create<IEmbed>();
|
||||
public virtual IReadOnlyCollection<ulong> MentionedChannelIds => ImmutableArray.Create<ulong>();
|
||||
|
||||
@@ -25,7 +25,6 @@ namespace Discord.Rest
|
||||
public override bool IsPinned => _isPinned;
|
||||
public override bool IsWebhook => WebhookId != null;
|
||||
public override DateTimeOffset? EditedTimestamp => DateTimeUtils.FromTicks(_editedTimestampTicks);
|
||||
|
||||
public override IReadOnlyCollection<IAttachment> Attachments => _attachments;
|
||||
public override IReadOnlyCollection<IEmbed> Embeds => _embeds;
|
||||
public override IReadOnlyCollection<ulong> MentionedChannelIds => _mentionedChannelIds;
|
||||
|
||||
@@ -10,7 +10,6 @@ namespace Discord.Rest
|
||||
public class RestRole : RestEntity<ulong>, IRole
|
||||
{
|
||||
public RestGuild Guild { get; }
|
||||
|
||||
public Color Color { get; private set; }
|
||||
public bool IsHoisted { get; private set; }
|
||||
public bool IsManaged { get; private set; }
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace Discord
|
||||
public string Type { get; }
|
||||
public string Name { get; }
|
||||
public bool IsRevoked { get; }
|
||||
|
||||
public IReadOnlyCollection<ulong> IntegrationIds { get; }
|
||||
|
||||
internal RestConnection(string id, string type, string name, bool isRevoked, IReadOnlyCollection<ulong> integrationIds)
|
||||
|
||||
Reference in New Issue
Block a user