Added WebhookId and IsWebhook
This commit is contained in:
@@ -17,6 +17,7 @@ namespace Discord.Rest
|
||||
|
||||
public virtual bool IsTTS => false;
|
||||
public virtual bool IsPinned => false;
|
||||
public virtual bool IsWebhook => false;
|
||||
public virtual DateTimeOffset? EditedTimestamp => null;
|
||||
|
||||
public virtual IReadOnlyCollection<IAttachment> Attachments => ImmutableArray.Create<IAttachment>();
|
||||
|
||||
@@ -18,9 +18,12 @@ namespace Discord.Rest
|
||||
private ImmutableArray<ulong> _mentionedChannelIds;
|
||||
private ImmutableArray<RestRole> _mentionedRoles;
|
||||
private ImmutableArray<RestUser> _mentionedUsers;
|
||||
|
||||
|
||||
public ulong? WebhookId { get; private set; }
|
||||
|
||||
public override bool IsTTS => _isTTS;
|
||||
public override bool IsPinned => _isPinned;
|
||||
public override bool IsWebhook => WebhookId != null;
|
||||
public override DateTimeOffset? EditedTimestamp => DateTimeUtils.FromTicks(_editedTimestampTicks);
|
||||
|
||||
public override IReadOnlyCollection<IAttachment> Attachments => _attachments;
|
||||
@@ -52,6 +55,8 @@ namespace Discord.Rest
|
||||
_editedTimestampTicks = model.EditedTimestamp.Value?.UtcTicks;
|
||||
if (model.MentionEveryone.IsSpecified)
|
||||
_isMentioningEveryone = model.MentionEveryone.Value;
|
||||
if (model.WebhookId.IsSpecified)
|
||||
WebhookId = model.WebhookId.Value;
|
||||
|
||||
if (model.Attachments.IsSpecified)
|
||||
{
|
||||
@@ -131,6 +136,6 @@ namespace Discord.Rest
|
||||
return text;
|
||||
}
|
||||
|
||||
private string DebuggerDisplay => $"{Author}: {Content} ({Id}{(Attachments.Count > 0 ? $", {Attachments.Count} Attachments" : "")}";
|
||||
private string DebuggerDisplay => $"{Author}: {Content} ({Id}{(Attachments.Count > 0 ? $", {Attachments.Count} Attachments" : "")})";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user