diff --git a/src/Discord.Net/DiscordClient.cs b/src/Discord.Net/DiscordClient.cs index 9e5c59a43..c410a3278 100644 --- a/src/Discord.Net/DiscordClient.cs +++ b/src/Discord.Net/DiscordClient.cs @@ -811,7 +811,7 @@ namespace Discord public Task AcceptInvite(Invite invite) { CheckReady(); - return DiscordAPI.AcceptInvite(invite.Code); + return DiscordAPI.AcceptInvite(invite.Id); } /// Accepts the provided invite. public async Task AcceptInvite(string id) diff --git a/src/Discord.Net/Invite.cs b/src/Discord.Net/Invite.cs index c49781813..ba5170aea 100644 --- a/src/Discord.Net/Invite.cs +++ b/src/Discord.Net/Invite.cs @@ -6,27 +6,46 @@ namespace Discord { private readonly DiscordClient _client; - public int MaxAge, Uses, MaxUses; - public bool IsRevoked, IsTemporary; - public readonly string Code, XkcdPass; + /// Returns the unique identifier for this invite. + public string Id { get; } + + /// Time (in seconds) until the invite expires. Set to 0 to never expire. + public int MaxAge { get; internal set; } + /// The amount of times this invite has been used. + public int Uses { get; internal set; } + /// The max amount of times this invite may be used. + public int MaxUses { get; internal set; } + /// Returns true if this invite has been destroyed, or you are banned from that server. + public bool IsRevoked { get; internal set; } + /// If true, a user accepting this invite will be kicked from the server after closing their client. + public bool IsTemporary { get; internal set; } + /// Returns, if enabled, an alternative human-readable code for URLs. + public string XkcdPass { get; } - public string Url => API.Endpoints.InviteUrl(XkcdPass ?? Code); + /// Returns a URL for this invite using XkcdPass if available or Id if not. + public string Url => API.Endpoints.InviteUrl(XkcdPass ?? Id); + /// Returns the id of the user that created this invite. public string InviterId { get; internal set; } + /// Returns the user that created this invite. [JsonIgnore] public User Inviter => _client.GetUser(InviterId); + /// Returns the id of the server this invite is to. public string ServerId { get; internal set; } + /// Returns the server this invite is to. [JsonIgnore] public Server Server => _client.GetServer(ServerId); + /// Returns the id of the channel this invite is to. public string ChannelId { get; internal set; } + /// Returns the channel this invite is to. [JsonIgnore] public Channel Channel => _client.GetChannel(ChannelId); internal Invite(string code, string xkcdPass, DiscordClient client) { - Code = code; + Id = code; XkcdPass = xkcdPass; _client = client; }