diff --git a/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs b/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs
index ee47a7280..3d08a8c51 100644
--- a/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs
+++ b/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs
@@ -20,7 +20,7 @@ namespace Discord
/// The time (in seconds) until the invite expires. Set to null to never expire.
/// The max amount of times this invite may be used. Set to null to have unlimited uses.
/// If true, a user accepting this invite will be kicked from the guild after closing their client.
- Task CreateInviteAsync(int? maxAge = 1800, int? maxUses = default(int?), bool isTemporary = false, RequestOptions options = null);
+ Task CreateInviteAsync(int? maxAge = 1800, int? maxUses = default(int?), bool isTemporary = false, bool isUnique = false, RequestOptions options = null);
/// Returns a collection of all invites to this channel.
Task> GetInvitesAsync(RequestOptions options = null);
diff --git a/src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs b/src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs
index cc3ca6dca..db79bc314 100644
--- a/src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs
+++ b/src/Discord.Net.Rest/API/Rest/CreateChannelInviteParams.cs
@@ -12,5 +12,7 @@ namespace Discord.API.Rest
public Optional MaxUses { get; set; }
[JsonProperty("temporary")]
public Optional IsTemporary { get; set; }
+ [JsonProperty("unique")]
+ public Optional IsUnique { get; set; }
}
}
diff --git a/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs b/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs
index 2036f8824..07bdfe0eb 100644
--- a/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs
+++ b/src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs
@@ -69,9 +69,9 @@ namespace Discord.Rest
return models.Select(x => RestInviteMetadata.Create(client, null, channel, x)).ToImmutableArray();
}
public static async Task CreateInviteAsync(IGuildChannel channel, BaseDiscordClient client,
- int? maxAge, int? maxUses, bool isTemporary, RequestOptions options)
+ int? maxAge, int? maxUses, bool isTemporary, bool isUnique, RequestOptions options)
{
- var args = new CreateChannelInviteParams { IsTemporary = isTemporary };
+ var args = new CreateChannelInviteParams { IsTemporary = isTemporary, IsUnique = isUnique };
if (maxAge.HasValue)
args.MaxAge = maxAge.Value;
else
diff --git a/src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs b/src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs
index edb751133..114c886c4 100644
--- a/src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs
+++ b/src/Discord.Net.Rest/Entities/Channels/RestGuildChannel.cs
@@ -118,8 +118,8 @@ namespace Discord.Rest
public async Task> GetInvitesAsync(RequestOptions options = null)
=> await ChannelHelper.GetInvitesAsync(this, Discord, options).ConfigureAwait(false);
- public async Task CreateInviteAsync(int? maxAge = 3600, int? maxUses = null, bool isTemporary = false, RequestOptions options = null)
- => await ChannelHelper.CreateInviteAsync(this, Discord, maxAge, maxUses, isTemporary, options).ConfigureAwait(false);
+ public async Task CreateInviteAsync(int? maxAge = 3600, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
+ => await ChannelHelper.CreateInviteAsync(this, Discord, maxAge, maxUses, isTemporary, isUnique, options).ConfigureAwait(false);
public override string ToString() => Name;
@@ -136,8 +136,8 @@ namespace Discord.Rest
async Task> IGuildChannel.GetInvitesAsync(RequestOptions options)
=> await GetInvitesAsync(options).ConfigureAwait(false);
- async Task IGuildChannel.CreateInviteAsync(int? maxAge, int? maxUses, bool isTemporary, RequestOptions options)
- => await CreateInviteAsync(maxAge, maxUses, isTemporary, options).ConfigureAwait(false);
+ async Task IGuildChannel.CreateInviteAsync(int? maxAge, int? maxUses, bool isTemporary, bool isUnique, RequestOptions options)
+ => await CreateInviteAsync(maxAge, maxUses, isTemporary, isUnique, options).ConfigureAwait(false);
OverwritePermissions? IGuildChannel.GetPermissionOverwrite(IRole role)
=> GetPermissionOverwrite(role);
diff --git a/src/Discord.Net.Rpc/Entities/Channels/RpcGuildChannel.cs b/src/Discord.Net.Rpc/Entities/Channels/RpcGuildChannel.cs
index 05feac03e..48eb8ec3e 100644
--- a/src/Discord.Net.Rpc/Entities/Channels/RpcGuildChannel.cs
+++ b/src/Discord.Net.Rpc/Entities/Channels/RpcGuildChannel.cs
@@ -51,8 +51,8 @@ namespace Discord.Rpc
public async Task> GetInvitesAsync(RequestOptions options = null)
=> await ChannelHelper.GetInvitesAsync(this, Discord, options).ConfigureAwait(false);
- public async Task CreateInviteAsync(int? maxAge = 3600, int? maxUses = null, bool isTemporary = false, RequestOptions options = null)
- => await ChannelHelper.CreateInviteAsync(this, Discord, maxAge, maxUses, isTemporary, options).ConfigureAwait(false);
+ public async Task CreateInviteAsync(int? maxAge = 3600, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
+ => await ChannelHelper.CreateInviteAsync(this, Discord, maxAge, maxUses, isTemporary, isUnique, options).ConfigureAwait(false);
public override string ToString() => Name;
@@ -68,8 +68,8 @@ namespace Discord.Rpc
async Task> IGuildChannel.GetInvitesAsync(RequestOptions options)
=> await GetInvitesAsync(options).ConfigureAwait(false);
- async Task IGuildChannel.CreateInviteAsync(int? maxAge, int? maxUses, bool isTemporary, RequestOptions options)
- => await CreateInviteAsync(maxAge, maxUses, isTemporary, options).ConfigureAwait(false);
+ async Task IGuildChannel.CreateInviteAsync(int? maxAge, int? maxUses, bool isTemporary, bool isUnique, RequestOptions options)
+ => await CreateInviteAsync(maxAge, maxUses, isTemporary, isUnique, options).ConfigureAwait(false);
IReadOnlyCollection IGuildChannel.PermissionOverwrites { get { throw new NotSupportedException(); } }
OverwritePermissions? IGuildChannel.GetPermissionOverwrite(IUser user)
diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs
index 6a56c97fe..0e7cfde82 100644
--- a/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs
+++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketGuildChannel.cs
@@ -112,8 +112,8 @@ namespace Discord.WebSocket
public async Task> GetInvitesAsync(RequestOptions options = null)
=> await ChannelHelper.GetInvitesAsync(this, Discord, options).ConfigureAwait(false);
- public async Task CreateInviteAsync(int? maxAge = 3600, int? maxUses = null, bool isTemporary = false, RequestOptions options = null)
- => await ChannelHelper.CreateInviteAsync(this, Discord, maxAge, maxUses, isTemporary, options).ConfigureAwait(false);
+ public async Task CreateInviteAsync(int? maxAge = 3600, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
+ => await ChannelHelper.CreateInviteAsync(this, Discord, maxAge, maxUses, isTemporary, isUnique, options).ConfigureAwait(false);
public new abstract SocketGuildUser GetUser(ulong id);
@@ -130,8 +130,8 @@ namespace Discord.WebSocket
async Task> IGuildChannel.GetInvitesAsync(RequestOptions options)
=> await GetInvitesAsync(options).ConfigureAwait(false);
- async Task IGuildChannel.CreateInviteAsync(int? maxAge, int? maxUses, bool isTemporary, RequestOptions options)
- => await CreateInviteAsync(maxAge, maxUses, isTemporary, options).ConfigureAwait(false);
+ async Task IGuildChannel.CreateInviteAsync(int? maxAge, int? maxUses, bool isTemporary, bool isUnique, RequestOptions options)
+ => await CreateInviteAsync(maxAge, maxUses, isTemporary, isUnique, options).ConfigureAwait(false);
OverwritePermissions? IGuildChannel.GetPermissionOverwrite(IRole role)
=> GetPermissionOverwrite(role);