diff --git a/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs b/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs index c3a2161cc..1da1879de 100644 --- a/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs +++ b/src/Discord.Net.Core/Entities/Channels/IGuildChannel.cs @@ -44,45 +44,6 @@ namespace Discord /// IReadOnlyCollection PermissionOverwrites { get; } - /// - /// Creates a new invite to this channel. - /// - /// - /// The following example creates a new invite to this channel; the invite lasts for 12 hours and can only - /// be used 3 times throughout its lifespan. - /// - /// await guildChannel.CreateInviteAsync(maxAge: 43200, maxUses: 3); - /// - /// - /// 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, the user accepting this invite will be kicked from the guild after closing their client. - /// If true, don't try to reuse a similar invite (useful for creating many unique one time use invites). - /// The options to be used when sending the request. - /// - /// A task that represents the asynchronous invite creation operation. The task result contains an invite - /// metadata object containing information for the created invite. - /// - Task CreateInviteAsync(int? maxAge = 86400, int? maxUses = default(int?), bool isTemporary = false, bool isUnique = false, RequestOptions options = null); - /// - /// Gets a collection of all invites to this channel. - /// - /// - /// The following example gets all of the invites that have been created in this channel and selects the - /// most used invite. - /// - /// var invites = await channel.GetInvitesAsync(); - /// if (invites.Count == 0) return; - /// var invite = invites.OrderByDescending(x => x.Uses).FirstOrDefault(); - /// - /// - /// The options to be used when sending the request. - /// - /// A task that represents the asynchronous get operation. The task result contains a read-only collection - /// of invite metadata that are created for this channel. - /// - Task> GetInvitesAsync(RequestOptions options = null); - /// /// Modifies this guild channel. /// diff --git a/src/Discord.Net.Core/Entities/Channels/INestedChannel.cs b/src/Discord.Net.Core/Entities/Channels/INestedChannel.cs index 22182a4ca..8ce759ad9 100644 --- a/src/Discord.Net.Core/Entities/Channels/INestedChannel.cs +++ b/src/Discord.Net.Core/Entities/Channels/INestedChannel.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Threading.Tasks; namespace Discord @@ -25,5 +26,44 @@ namespace Discord /// representing the parent of this channel; null if none is set. /// Task GetCategoryAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null); + + /// + /// Creates a new invite to this channel. + /// + /// + /// The following example creates a new invite to this channel; the invite lasts for 12 hours and can only + /// be used 3 times throughout its lifespan. + /// + /// await guildChannel.CreateInviteAsync(maxAge: 43200, maxUses: 3); + /// + /// + /// 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, the user accepting this invite will be kicked from the guild after closing their client. + /// If true, don't try to reuse a similar invite (useful for creating many unique one time use invites). + /// The options to be used when sending the request. + /// + /// A task that represents the asynchronous invite creation operation. The task result contains an invite + /// metadata object containing information for the created invite. + /// + Task CreateInviteAsync(int? maxAge = 86400, int? maxUses = default(int?), bool isTemporary = false, bool isUnique = false, RequestOptions options = null); + /// + /// Gets a collection of all invites to this channel. + /// B + /// + /// The following example gets all of the invites that have been created in this channel and selects the + /// most used invite. + /// + /// var invites = await channel.GetInvitesAsync(); + /// if (invites.Count == 0) return; + /// var invite = invites.OrderByDescending(x => x.Uses).FirstOrDefault(); + /// + /// + /// The options to be used when sending the request. + /// + /// A task that represents the asynchronous get operation. The task result contains a read-only collection + /// of invite metadata that are created for this channel. + /// + Task> GetInvitesAsync(RequestOptions options = null); } } diff --git a/src/Discord.Net.Rest/Entities/Channels/RestCategoryChannel.cs b/src/Discord.Net.Rest/Entities/Channels/RestCategoryChannel.cs index 9d69d6bdc..177bde21d 100644 --- a/src/Discord.Net.Rest/Entities/Channels/RestCategoryChannel.cs +++ b/src/Discord.Net.Rest/Entities/Channels/RestCategoryChannel.cs @@ -25,16 +25,6 @@ namespace Discord.Rest private string DebuggerDisplay => $"{Name} ({Id}, Category)"; - // IGuildChannel - /// - /// This method is not supported with category channels. - Task IGuildChannel.CreateInviteAsync(int? maxAge, int? maxUses, bool isTemporary, bool isUnique, RequestOptions options) - => throw new NotSupportedException(); - /// - /// This method is not supported with category channels. - Task> IGuildChannel.GetInvitesAsync(RequestOptions options) - => throw new NotSupportedException(); - //IChannel /// /// This method is not supported with category channels. diff --git a/src/Discord.Net.WebSocket/Entities/Channels/SocketCategoryChannel.cs b/src/Discord.Net.WebSocket/Entities/Channels/SocketCategoryChannel.cs index 0ae40820c..b90c1976a 100644 --- a/src/Discord.Net.WebSocket/Entities/Channels/SocketCategoryChannel.cs +++ b/src/Discord.Net.WebSocket/Entities/Channels/SocketCategoryChannel.cs @@ -67,14 +67,6 @@ namespace Discord.WebSocket /// Task IGuildChannel.GetUserAsync(ulong id, CacheMode mode, RequestOptions options) => Task.FromResult(GetUser(id)); - /// - /// This method is not supported with category channels. - Task IGuildChannel.CreateInviteAsync(int? maxAge, int? maxUses, bool isTemporary, bool isUnique, RequestOptions options) - => throw new NotSupportedException(); - /// - /// This method is not supported with category channels. - Task> IGuildChannel.GetInvitesAsync(RequestOptions options) - => throw new NotSupportedException(); //IChannel ///