Refactor, rearrange, reimplement reactions; receive over gateway
This commit is contained in:
@@ -27,7 +27,6 @@ namespace Discord.Rest
|
||||
public virtual IReadOnlyCollection<ulong> MentionedRoleIds => ImmutableArray.Create<ulong>();
|
||||
public virtual IReadOnlyCollection<RestUser> MentionedUsers => ImmutableArray.Create<RestUser>();
|
||||
public virtual IReadOnlyCollection<ITag> Tags => ImmutableArray.Create<ITag>();
|
||||
public virtual IReadOnlyCollection<IReaction> Reactions => ImmutableArray.Create<RestReaction>();
|
||||
public virtual ulong? WebhookId => null;
|
||||
public bool IsWebhook => WebhookId != null;
|
||||
|
||||
@@ -71,6 +70,5 @@ namespace Discord.Rest
|
||||
IReadOnlyCollection<IAttachment> IMessage.Attachments => Attachments;
|
||||
IReadOnlyCollection<IEmbed> IMessage.Embeds => Embeds;
|
||||
IReadOnlyCollection<ulong> IMessage.MentionedUserIds => MentionedUsers.Select(x => x.Id).ToImmutableArray();
|
||||
IReadOnlyCollection<IReaction> IMessage.Reactions => Reactions;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,17 +10,13 @@ namespace Discord
|
||||
{
|
||||
internal RestReaction(Model model)
|
||||
{
|
||||
_emoji = model.Emoji;
|
||||
_count = model.Count;
|
||||
|
||||
Emoji = Emoji.FromApi(model.Emoji);
|
||||
Count = model.Count;
|
||||
Me = model.Me;
|
||||
}
|
||||
|
||||
internal readonly API.Emoji _emoji;
|
||||
internal readonly int _count;
|
||||
internal readonly bool _me;
|
||||
|
||||
public API.Emoji Emoji => _emoji;
|
||||
public int Count => _count;
|
||||
public bool Me => _me;
|
||||
public Emoji Emoji { get; private set; }
|
||||
public int Count { get; private set; }
|
||||
public bool Me { get; private set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Discord.Rest
|
||||
public override IReadOnlyCollection<ulong> MentionedRoleIds => MessageHelper.FilterTagsByKey(TagType.RoleMention, _tags);
|
||||
public override IReadOnlyCollection<RestUser> MentionedUsers => MessageHelper.FilterTagsByValue<RestUser>(TagType.UserMention, _tags);
|
||||
public override IReadOnlyCollection<ITag> Tags => _tags;
|
||||
public override IReadOnlyCollection<IReaction> Reactions => _reactions;
|
||||
public IReadOnlyDictionary<Emoji, int> Reactions => _reactions.ToDictionary(x => x.Emoji, x => x.Count);
|
||||
|
||||
internal RestUserMessage(BaseDiscordClient discord, ulong id, IMessageChannel channel, RestUser author, IGuild guild)
|
||||
: base(discord, id, channel, author, guild)
|
||||
|
||||
Reference in New Issue
Block a user