Missing invite properties (#2615)
This commit is contained in:
@@ -16,6 +16,11 @@ namespace Discord
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
IGuild Guild { get; }
|
IGuild Guild { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the id of the guild this event is scheduled in.
|
||||||
|
/// </summary>
|
||||||
|
ulong GuildId { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the optional channel id where this event will be hosted.
|
/// Gets the optional channel id where this event will be hosted.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -60,5 +60,20 @@ namespace Discord
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string PrivacyPolicy { get; }
|
public string PrivacyPolicy { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets application's default custom authorization url. <see langword="null" /> if disabled.
|
||||||
|
/// </summary>
|
||||||
|
public string CustomInstallUrl { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the application's role connection verification entry point. <see langword="null" /> if not set.
|
||||||
|
/// </summary>
|
||||||
|
public string RoleConnectionsVerificationUrl { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the hex encoded key for verification in interactions.
|
||||||
|
/// </summary>
|
||||||
|
public string VerifyKey { get; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
namespace Discord
|
namespace Discord
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -80,7 +82,7 @@ namespace Discord
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// An <see cref="System.Int32" /> representing the approximated online member count of the guild that the
|
/// An <see cref="System.Int32" /> representing the approximated online member count of the guild that the
|
||||||
/// invite points to; <c>null</c> if one cannot be obtained.
|
/// invite points to; <see langword="null" /> if one cannot be obtained.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
int? PresenceCount { get; }
|
int? PresenceCount { get; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -88,7 +90,7 @@ namespace Discord
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// An <see cref="System.Int32" /> representing the approximated total member count of the guild that the
|
/// An <see cref="System.Int32" /> representing the approximated total member count of the guild that the
|
||||||
/// invite points to; <c>null</c> if one cannot be obtained.
|
/// invite points to; <see langword="null" /> if one cannot be obtained.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
int? MemberCount { get; }
|
int? MemberCount { get; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -105,5 +107,19 @@ namespace Discord
|
|||||||
/// The type of the linked user that is linked to this invite.
|
/// The type of the linked user that is linked to this invite.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
TargetUserType TargetUserType { get; }
|
TargetUserType TargetUserType { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the embedded application to open for this voice channel embedded application invite.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>
|
||||||
|
/// A partial <see cref="IApplication"/> object. <see langword="null" /> if <see cref="TargetUserType"/>
|
||||||
|
/// is not <see cref="TargetUserType.EmbeddedApplication"/>.
|
||||||
|
/// </returns>
|
||||||
|
IApplication Application { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the expiration date of this invite. <see langword="null" /> if the invite never expires.
|
||||||
|
/// </summary>
|
||||||
|
DateTimeOffset? ExpiresAt { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,5 +32,14 @@ namespace Discord.API
|
|||||||
public string TermsOfService { get; set; }
|
public string TermsOfService { get; set; }
|
||||||
[JsonProperty("privacy_policy_url")]
|
[JsonProperty("privacy_policy_url")]
|
||||||
public string PrivacyPolicy { get; set; }
|
public string PrivacyPolicy { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("custom_install_url")]
|
||||||
|
public Optional<string> CustomInstallUrl { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("role_connections_verification_url")]
|
||||||
|
public Optional<string> RoleConnectionsUrl { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("verify_key")]
|
||||||
|
public string VerifyKey { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace Discord.API
|
namespace Discord.API
|
||||||
{
|
{
|
||||||
@@ -6,19 +7,35 @@ namespace Discord.API
|
|||||||
{
|
{
|
||||||
[JsonProperty("code")]
|
[JsonProperty("code")]
|
||||||
public string Code { get; set; }
|
public string Code { get; set; }
|
||||||
|
|
||||||
[JsonProperty("guild")]
|
[JsonProperty("guild")]
|
||||||
public Optional<InviteGuild> Guild { get; set; }
|
public Optional<InviteGuild> Guild { get; set; }
|
||||||
|
|
||||||
[JsonProperty("channel")]
|
[JsonProperty("channel")]
|
||||||
public InviteChannel Channel { get; set; }
|
public InviteChannel Channel { get; set; }
|
||||||
|
|
||||||
[JsonProperty("inviter")]
|
[JsonProperty("inviter")]
|
||||||
public Optional<User> Inviter { get; set; }
|
public Optional<User> Inviter { get; set; }
|
||||||
|
|
||||||
[JsonProperty("approximate_presence_count")]
|
[JsonProperty("approximate_presence_count")]
|
||||||
public Optional<int?> PresenceCount { get; set; }
|
public Optional<int?> PresenceCount { get; set; }
|
||||||
|
|
||||||
[JsonProperty("approximate_member_count")]
|
[JsonProperty("approximate_member_count")]
|
||||||
public Optional<int?> MemberCount { get; set; }
|
public Optional<int?> MemberCount { get; set; }
|
||||||
|
|
||||||
[JsonProperty("target_user")]
|
[JsonProperty("target_user")]
|
||||||
public Optional<User> TargetUser { get; set; }
|
public Optional<User> TargetUser { get; set; }
|
||||||
[JsonProperty("target_user_type")]
|
|
||||||
|
[JsonProperty("target_type")]
|
||||||
public Optional<TargetUserType> TargetUserType { get; set; }
|
public Optional<TargetUserType> TargetUserType { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("target_application")]
|
||||||
|
public Optional<Application> Application { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("expires_at")]
|
||||||
|
public Optional<DateTimeOffset?> ExpiresAt { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("guild_scheduled_event")]
|
||||||
|
public Optional<GuildScheduledEvent> ScheduledEvent { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,10 +52,9 @@ namespace Discord.Rest
|
|||||||
return models.Select(model => RestConnection.Create(client, model)).ToImmutableArray();
|
return models.Select(model => RestConnection.Create(client, model)).ToImmutableArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<RestInviteMetadata> GetInviteAsync(BaseDiscordClient client,
|
public static async Task<RestInviteMetadata> GetInviteAsync(BaseDiscordClient client, string inviteId, RequestOptions options, ulong? scheduledEventId = null)
|
||||||
string inviteId, RequestOptions options)
|
|
||||||
{
|
{
|
||||||
var model = await client.ApiClient.GetInviteAsync(inviteId, options).ConfigureAwait(false);
|
var model = await client.ApiClient.GetInviteAsync(inviteId, options, scheduledEventId).ConfigureAwait(false);
|
||||||
if (model != null)
|
if (model != null)
|
||||||
return RestInviteMetadata.Create(client, null, null, model);
|
return RestInviteMetadata.Create(client, null, null, model);
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -1732,7 +1732,7 @@ namespace Discord.API
|
|||||||
#region Guild Invites
|
#region Guild Invites
|
||||||
/// <exception cref="ArgumentException"><paramref name="inviteId"/> cannot be blank.</exception>
|
/// <exception cref="ArgumentException"><paramref name="inviteId"/> cannot be blank.</exception>
|
||||||
/// <exception cref="ArgumentNullException"><paramref name="inviteId"/> must not be <see langword="null"/>.</exception>
|
/// <exception cref="ArgumentNullException"><paramref name="inviteId"/> must not be <see langword="null"/>.</exception>
|
||||||
public async Task<InviteMetadata> GetInviteAsync(string inviteId, RequestOptions options = null)
|
public async Task<InviteMetadata> GetInviteAsync(string inviteId, RequestOptions options = null, ulong? scheduledEventId = null)
|
||||||
{
|
{
|
||||||
Preconditions.NotNullOrEmpty(inviteId, nameof(inviteId));
|
Preconditions.NotNullOrEmpty(inviteId, nameof(inviteId));
|
||||||
options = RequestOptions.CreateOrClone(options);
|
options = RequestOptions.CreateOrClone(options);
|
||||||
@@ -1745,9 +1745,13 @@ namespace Discord.API
|
|||||||
if (index >= 0)
|
if (index >= 0)
|
||||||
inviteId = inviteId.Substring(index + 1);
|
inviteId = inviteId.Substring(index + 1);
|
||||||
|
|
||||||
|
var scheduledEventQuery = scheduledEventId is not null
|
||||||
|
? $"&guild_scheduled_event_id={scheduledEventId}"
|
||||||
|
: string.Empty;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return await SendAsync<InviteMetadata>("GET", () => $"invites/{inviteId}?with_counts=true", new BucketIds(), options: options).ConfigureAwait(false);
|
return await SendAsync<InviteMetadata>("GET", () => $"invites/{inviteId}?with_counts=true&with_expiration=true{scheduledEventQuery}", new BucketIds(), options: options).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch (HttpException ex) when (ex.HttpCode == HttpStatusCode.NotFound) { return null; }
|
catch (HttpException ex) when (ex.HttpCode == HttpStatusCode.NotFound) { return null; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,8 +182,8 @@ namespace Discord.Rest
|
|||||||
public Task<IReadOnlyCollection<RestConnection>> GetConnectionsAsync(RequestOptions options = null)
|
public Task<IReadOnlyCollection<RestConnection>> GetConnectionsAsync(RequestOptions options = null)
|
||||||
=> ClientHelper.GetConnectionsAsync(this, options);
|
=> ClientHelper.GetConnectionsAsync(this, options);
|
||||||
|
|
||||||
public Task<RestInviteMetadata> GetInviteAsync(string inviteId, RequestOptions options = null)
|
public Task<RestInviteMetadata> GetInviteAsync(string inviteId, RequestOptions options = null, ulong? scheduledEventId = null)
|
||||||
=> ClientHelper.GetInviteAsync(this, inviteId, options);
|
=> ClientHelper.GetInviteAsync(this, inviteId, options, scheduledEventId);
|
||||||
|
|
||||||
public Task<RestGuild> GetGuildAsync(ulong id, RequestOptions options = null)
|
public Task<RestGuild> GetGuildAsync(ulong id, RequestOptions options = null)
|
||||||
=> ClientHelper.GetGuildAsync(this, id, false, options);
|
=> ClientHelper.GetGuildAsync(this, id, false, options);
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ namespace Discord.Rest
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public IGuild Guild { get; private set; }
|
public IGuild Guild { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public ulong GuildId { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public ulong? ChannelId { get; private set; }
|
public ulong? ChannelId { get; private set; }
|
||||||
|
|
||||||
@@ -102,6 +105,7 @@ namespace Discord.Rest
|
|||||||
Location = model.EntityMetadata?.Location.GetValueOrDefault();
|
Location = model.EntityMetadata?.Location.GetValueOrDefault();
|
||||||
UserCount = model.UserCount.ToNullable();
|
UserCount = model.UserCount.ToNullable();
|
||||||
CoverImageId = model.Image;
|
CoverImageId = model.Image;
|
||||||
|
GuildId = model.GuildId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|||||||
@@ -38,6 +38,17 @@ namespace Discord.Rest
|
|||||||
/// </returns>
|
/// </returns>
|
||||||
public InviteGuild InviteGuild { get; private set; }
|
public InviteGuild InviteGuild { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IInvite.Application" />
|
||||||
|
public RestApplication Application { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public DateTimeOffset? ExpiresAt { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets guild scheduled event data. <see langword="null" /> if event id was invalid.
|
||||||
|
/// </summary>
|
||||||
|
public RestGuildEvent ScheduledEvent { get; private set; }
|
||||||
|
|
||||||
internal IChannel Channel { get; }
|
internal IChannel Channel { get; }
|
||||||
|
|
||||||
internal IGuild Guild { get; }
|
internal IGuild Guild { get; }
|
||||||
@@ -97,6 +108,14 @@ namespace Discord.Rest
|
|||||||
ch.EmojiId.IsSpecified ? ch.EmojiId.Value : null)).ToImmutableArray())
|
ch.EmojiId.IsSpecified ? ch.EmojiId.Value : null)).ToImmutableArray())
|
||||||
: null);
|
: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(model.Application.IsSpecified)
|
||||||
|
Application = RestApplication.Create(Discord, model.Application.Value);
|
||||||
|
|
||||||
|
ExpiresAt = model.ExpiresAt.IsSpecified ? model.ExpiresAt.Value : null;
|
||||||
|
|
||||||
|
if(model.ScheduledEvent.IsSpecified)
|
||||||
|
ScheduledEvent = RestGuildEvent.Create(Discord, Guild, model.ScheduledEvent.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -118,6 +137,8 @@ namespace Discord.Rest
|
|||||||
public override string ToString() => Url;
|
public override string ToString() => Url;
|
||||||
private string DebuggerDisplay => $"{Url} ({GuildName} / {ChannelName})";
|
private string DebuggerDisplay => $"{Url} ({GuildName} / {ChannelName})";
|
||||||
|
|
||||||
|
#region IInvite
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
IGuild IInvite.Guild
|
IGuild IInvite.Guild
|
||||||
{
|
{
|
||||||
@@ -140,5 +161,10 @@ namespace Discord.Rest
|
|||||||
throw new InvalidOperationException("Unable to return this entity's parent unless it was fetched through that object.");
|
throw new InvalidOperationException("Unable to return this entity's parent unless it was fetched through that object.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
IApplication IInvite.Application => Application;
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,14 @@ namespace Discord.Rest
|
|||||||
public string TermsOfService { get; private set; }
|
public string TermsOfService { get; private set; }
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string PrivacyPolicy { get; private set; }
|
public string PrivacyPolicy { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public string VerifyKey { get; private set; }
|
||||||
|
/// <inheritdoc />
|
||||||
|
public string CustomInstallUrl { get; private set; }
|
||||||
|
/// <inheritdoc />
|
||||||
|
public string RoleConnectionsVerificationUrl { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);
|
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -74,6 +82,10 @@ namespace Discord.Rest
|
|||||||
Owner = RestUser.Create(Discord, model.Owner.Value);
|
Owner = RestUser.Create(Discord, model.Owner.Value);
|
||||||
if (model.Team != null)
|
if (model.Team != null)
|
||||||
Team = RestTeam.Create(Discord, model.Team);
|
Team = RestTeam.Create(Discord, model.Team);
|
||||||
|
|
||||||
|
CustomInstallUrl = model.CustomInstallUrl.IsSpecified ? model.CustomInstallUrl.Value : null;
|
||||||
|
RoleConnectionsVerificationUrl = model.RoleConnectionsUrl.IsSpecified ? model.RoleConnectionsUrl.Value : null;
|
||||||
|
VerifyKey = model.VerifyKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <exception cref="InvalidOperationException">Unable to update this object from a different application token.</exception>
|
/// <exception cref="InvalidOperationException">Unable to update this object from a different application token.</exception>
|
||||||
|
|||||||
@@ -21,11 +21,17 @@ namespace Discord.API.Gateway
|
|||||||
public int MaxUses { get; set; }
|
public int MaxUses { get; set; }
|
||||||
[JsonProperty("target_user")]
|
[JsonProperty("target_user")]
|
||||||
public Optional<User> TargetUser { get; set; }
|
public Optional<User> TargetUser { get; set; }
|
||||||
[JsonProperty("target_user_type")]
|
[JsonProperty("target_type")]
|
||||||
public Optional<TargetUserType> TargetUserType { get; set; }
|
public Optional<TargetUserType> TargetUserType { get; set; }
|
||||||
[JsonProperty("temporary")]
|
[JsonProperty("temporary")]
|
||||||
public bool Temporary { get; set; }
|
public bool Temporary { get; set; }
|
||||||
[JsonProperty("uses")]
|
[JsonProperty("uses")]
|
||||||
public int Uses { get; set; }
|
public int Uses { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("target_application")]
|
||||||
|
public Optional<Application> Application { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("expires_at")]
|
||||||
|
public Optional<DateTimeOffset?> ExpiresAt { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -268,11 +268,12 @@ namespace Discord.WebSocket
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="inviteId">The invitation identifier.</param>
|
/// <param name="inviteId">The invitation identifier.</param>
|
||||||
/// <param name="options">The options to be used when sending the request.</param>
|
/// <param name="options">The options to be used when sending the request.</param>
|
||||||
|
/// <param name="scheduledEventId">The id of the guild scheduled event to include with the invite.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// A task that represents the asynchronous get operation. The task result contains the invite information.
|
/// A task that represents the asynchronous get operation. The task result contains the invite information.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public Task<RestInviteMetadata> GetInviteAsync(string inviteId, RequestOptions options = null)
|
public Task<RestInviteMetadata> GetInviteAsync(string inviteId, RequestOptions options = null, ulong? scheduledEventId = null)
|
||||||
=> ClientHelper.GetInviteAsync(this, inviteId, options ?? RequestOptions.Default);
|
=> ClientHelper.GetInviteAsync(this, inviteId, options ?? RequestOptions.Default, scheduledEventId);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a sticker.
|
/// Gets a sticker.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ namespace Discord.WebSocket
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public SocketGuild Guild { get; private set; }
|
public SocketGuild Guild { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public ulong GuildId { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the channel of the event.
|
/// Gets the channel of the event.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -113,6 +116,7 @@ namespace Discord.WebSocket
|
|||||||
Status = model.Status;
|
Status = model.Status;
|
||||||
UserCount = model.UserCount.ToNullable();
|
UserCount = model.UserCount.ToNullable();
|
||||||
CoverImageId = model.Image;
|
CoverImageId = model.Image;
|
||||||
|
GuildId = model.GuildId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|||||||
@@ -90,6 +90,12 @@ namespace Discord.WebSocket
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public TargetUserType TargetUserType { get; private set; }
|
public TargetUserType TargetUserType { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IInvite.Application" />
|
||||||
|
public RestApplication Application { get; private set; }
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public DateTimeOffset? ExpiresAt { get; private set; }
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string Code => Id;
|
public string Code => Id;
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -119,6 +125,8 @@ namespace Discord.WebSocket
|
|||||||
Uses = model.Uses;
|
Uses = model.Uses;
|
||||||
_createdAtTicks = model.CreatedAt.UtcTicks;
|
_createdAtTicks = model.CreatedAt.UtcTicks;
|
||||||
TargetUserType = model.TargetUserType.IsSpecified ? model.TargetUserType.Value : TargetUserType.Undefined;
|
TargetUserType = model.TargetUserType.IsSpecified ? model.TargetUserType.Value : TargetUserType.Undefined;
|
||||||
|
ExpiresAt = model.ExpiresAt.IsSpecified ? model.ExpiresAt.Value : null;
|
||||||
|
Application = model.Application.IsSpecified ? RestApplication.Create(Discord, model.Application.Value) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -134,6 +142,8 @@ namespace Discord.WebSocket
|
|||||||
public override string ToString() => Url;
|
public override string ToString() => Url;
|
||||||
private string DebuggerDisplay => $"{Url} ({Guild?.Name} / {Channel.Name})";
|
private string DebuggerDisplay => $"{Url} ({Guild?.Name} / {Channel.Name})";
|
||||||
|
|
||||||
|
#region IInvite
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
IGuild IInvite.Guild => Guild;
|
IGuild IInvite.Guild => Guild;
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -142,5 +152,10 @@ namespace Discord.WebSocket
|
|||||||
IUser IInvite.Inviter => Inviter;
|
IUser IInvite.Inviter => Inviter;
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
IUser IInvite.TargetUser => TargetUser;
|
IUser IInvite.TargetUser => TargetUser;
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
IApplication IInvite.Application => Application;
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user