From 2912107c35116688fab9faba634c768001930945 Mon Sep 17 00:00:00 2001 From: RogueException Date: Sat, 30 Jul 2016 00:44:26 -0300 Subject: [PATCH] Removed IGuild.CreateInviteAsync --- src/Discord.Net/Entities/Guilds/IGuild.cs | 5 ----- src/Discord.Net/Rest/Entities/Guilds/Guild.cs | 14 -------------- 2 files changed, 19 deletions(-) diff --git a/src/Discord.Net/Entities/Guilds/IGuild.cs b/src/Discord.Net/Entities/Guilds/IGuild.cs index b59f9aa0d..fc55334ef 100644 --- a/src/Discord.Net/Entities/Guilds/IGuild.cs +++ b/src/Discord.Net/Entities/Guilds/IGuild.cs @@ -82,11 +82,6 @@ namespace Discord /// Gets a collection of all invites to this guild. Task> GetInvitesAsync(); - /// Creates a new invite to this guild. - /// 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); /// Gets the role in this guild with the provided id, or null if not found. IRole GetRole(ulong id); diff --git a/src/Discord.Net/Rest/Entities/Guilds/Guild.cs b/src/Discord.Net/Rest/Entities/Guilds/Guild.cs index e08679b35..43c6f9e5d 100644 --- a/src/Discord.Net/Rest/Entities/Guilds/Guild.cs +++ b/src/Discord.Net/Rest/Entities/Guilds/Guild.cs @@ -220,20 +220,6 @@ namespace Discord var models = await Discord.ApiClient.GetGuildInvitesAsync(Id).ConfigureAwait(false); return models.Select(x => new InviteMetadata(Discord, x)).ToImmutableArray(); } - public async Task CreateInviteAsync(int? maxAge = 1800, int? maxUses = null, bool isTemporary = false) - { - if (maxAge <= 0) throw new ArgumentOutOfRangeException(nameof(maxAge)); - if (maxUses <= 0) throw new ArgumentOutOfRangeException(nameof(maxUses)); - - var args = new CreateChannelInviteParams() - { - MaxAge = maxAge ?? 0, - MaxUses = maxUses ?? 0, - Temporary = isTemporary - }; - var model = await Discord.ApiClient.CreateChannelInviteAsync(DefaultChannelId, args).ConfigureAwait(false); - return new InviteMetadata(Discord, model); - } public Role GetRole(ulong id) {