Add support for channel categories (#907)
commit a85c5814a74e473e95fe172f0379cbc7f9f951d8
Author: Christopher F <computerizedtaco@gmail.com>
Date: Sat Jan 6 22:25:48 2018 -0500
Code cleanup
commit 4b243fd3dd99152b4ebc7ee01d704bd8e57eeee1
Author: Christopher F <computerizedtaco@gmail.com>
Date: Sat Jan 6 22:08:28 2018 -0500
Add support for channel categories (#907)
commit 41ed9106f2b05530acbf06b245c9aa618011d815
Author: mrspits4ever <spits.lucas@gmail.com>
Date: Thu Dec 14 20:02:57 2017 +0100
removed mentioning support for RestCategoryChannel, added channels property to SocketCategoryChannel
commit 71142c310847886dff80c49e9357dd0786d67a1b
Merge: 4589d731 678a7238
Author: mrspits4ever <spits.lucas@gmail.com>
Date: Wed Dec 13 21:17:53 2017 +0100
Merge branch 'dev' of https://github.com/RogueException/Discord.Net into feature/channel-categories
commit 4589d73187871c98485ed25c6d223706927af7ec
Author: mrspits4ever <spits.lucas@gmail.com>
Date: Wed Dec 13 21:17:46 2017 +0100
adressed requested changes
commit d59b038efa048b2279602e2015ddd2c185e58d63
Author: pegasy <pegasy@users.noreply.github.com>
Date: Mon Sep 25 18:53:23 2017 +0200
Renamed classes / properties / methods to use CategoryChannel instead of ChannelCategory to be consistant with how text / voice channels are named.
commit 5c4777dc8cc443108f2e7e4afae98824c9a32b1f
Author: pegasy <pegasy@users.noreply.github.com>
Date: Sun Sep 24 19:08:25 2017 +0200
removed Guild from class name for ChannelCategory
Renamed all properties to use Category instead of Parent
Throw exception on GetUsers / GetInvites etc for categories
commit e18bd8c799d2327270021c05866cb2e97ad4671b
Author: pegasy <pegasy@users.noreply.github.com>
Date: Sun Sep 24 15:49:51 2017 +0200
Add support for channel categories (as its own channel type)
This commit is contained in:
@@ -26,5 +26,9 @@
|
||||
/// Move the channel to the following position. This is 0-based!
|
||||
/// </summary>
|
||||
public Optional<int> Position { get; set; }
|
||||
/// <summary>
|
||||
/// Sets the category for this channel
|
||||
/// </summary>
|
||||
public Optional<ulong?> CategoryId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
12
src/Discord.Net.Core/Entities/Channels/ICategoryChannel.cs
Normal file
12
src/Discord.Net.Core/Entities/Channels/ICategoryChannel.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Discord
|
||||
{
|
||||
public interface ICategoryChannel : IGuildChannel
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,10 @@ namespace Discord
|
||||
/// <summary> Gets the position of this channel in the guild's channel list, relative to others of the same type. </summary>
|
||||
int Position { get; }
|
||||
|
||||
/// <summary> Gets the parentid (category) of this channel in the guild's channel list. </summary>
|
||||
ulong? CategoryId { get; }
|
||||
/// <summary> Gets the parent channel (category) of this channel. </summary>
|
||||
Task<ICategoryChannel> GetCategoryAsync();
|
||||
/// <summary> Gets the guild this channel is a member of. </summary>
|
||||
IGuild Guild { get; }
|
||||
/// <summary> Gets the id of the guild this channel is a member of. </summary>
|
||||
@@ -23,7 +27,7 @@ namespace Discord
|
||||
Task<IInviteMetadata> CreateInviteAsync(int? maxAge = 86400, int? maxUses = default(int?), bool isTemporary = false, bool isUnique = false, RequestOptions options = null);
|
||||
/// <summary> Returns a collection of all invites to this channel. </summary>
|
||||
Task<IReadOnlyCollection<IInviteMetadata>> GetInvitesAsync(RequestOptions options = null);
|
||||
|
||||
|
||||
/// <summary> Modifies this guild channel. </summary>
|
||||
Task ModifyAsync(Action<GuildChannelProperties> func, RequestOptions options = null);
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ namespace Discord
|
||||
Task<IReadOnlyCollection<ITextChannel>> GetTextChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
|
||||
Task<ITextChannel> GetTextChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
|
||||
Task<IReadOnlyCollection<IVoiceChannel>> GetVoiceChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
|
||||
Task<IReadOnlyCollection<ICategoryChannel>> GetCategoriesAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
|
||||
Task<IVoiceChannel> GetVoiceChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
|
||||
Task<IVoiceChannel> GetAFKChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
|
||||
Task<ITextChannel> GetSystemChannelAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null);
|
||||
@@ -93,6 +94,8 @@ namespace Discord
|
||||
Task<ITextChannel> CreateTextChannelAsync(string name, RequestOptions options = null);
|
||||
/// <summary> Creates a new voice channel. </summary>
|
||||
Task<IVoiceChannel> CreateVoiceChannelAsync(string name, RequestOptions options = null);
|
||||
/// <summary> Creates a new channel category. </summary>
|
||||
Task<ICategoryChannel> CreateCategoryAsync(string name, RequestOptions options = null);
|
||||
|
||||
Task<IReadOnlyCollection<IGuildIntegration>> GetIntegrationsAsync(RequestOptions options = null);
|
||||
Task<IGuildIntegration> CreateIntegrationAsync(ulong id, string type, RequestOptions options = null);
|
||||
|
||||
Reference in New Issue
Block a user