Get Archived thread calls on text channels (#3198)
* Get Archived thread calls on text channels * Throw not supported exceptions on Thread&Voice channels * Extract interface * Should probably also change these * Move to regions
This commit is contained in:
@@ -10,7 +10,7 @@ namespace Discord
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a forum channel in a guild that can create posts.
|
/// Represents a forum channel in a guild that can create posts.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IForumChannel : IMentionable, INestedChannel, IIntegrationChannel
|
public interface IForumChannel : IMentionable, INestedChannel, IIntegrationChannel, IThreadContainerChannel
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value that indicates whether the channel is NSFW.
|
/// Gets a value that indicates whether the channel is NSFW.
|
||||||
@@ -226,53 +226,5 @@ namespace Discord
|
|||||||
int? slowmode = null, string text = null, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null,
|
int? slowmode = null, string text = null, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null,
|
||||||
MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = MessageFlags.None, ForumTag[] tags = null);
|
MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = MessageFlags.None, ForumTag[] tags = null);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a collection of active threads within this forum channel.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="options">The options to be used when sending the request.</param>
|
|
||||||
/// <returns>
|
|
||||||
/// A task that represents an asynchronous get operation for retrieving the threads. The task result contains
|
|
||||||
/// a collection of active threads.
|
|
||||||
/// </returns>
|
|
||||||
Task<IReadOnlyCollection<IThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a collection of publicly archived threads within this forum channel.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="limit">The optional limit of how many to get.</param>
|
|
||||||
/// <param name="before">The optional date to return threads created before this timestamp.</param>
|
|
||||||
/// <param name="options">The options to be used when sending the request.</param>
|
|
||||||
/// <returns>
|
|
||||||
/// A task that represents an asynchronous get operation for retrieving the threads. The task result contains
|
|
||||||
/// a collection of publicly archived threads.
|
|
||||||
/// </returns>
|
|
||||||
Task<IReadOnlyCollection<IThreadChannel>> GetPublicArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a collection of privately archived threads within this forum channel.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// The bot requires the <see cref="GuildPermission.ManageThreads"/> permission in order to execute this request.
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="limit">The optional limit of how many to get.</param>
|
|
||||||
/// <param name="before">The optional date to return threads created before this timestamp.</param>
|
|
||||||
/// <param name="options">The options to be used when sending the request.</param>
|
|
||||||
/// <returns>
|
|
||||||
/// A task that represents an asynchronous get operation for retrieving the threads. The task result contains
|
|
||||||
/// a collection of privately archived threads.
|
|
||||||
/// </returns>
|
|
||||||
Task<IReadOnlyCollection<IThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a collection of privately archived threads that the current bot has joined within this forum channel.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="limit">The optional limit of how many to get.</param>
|
|
||||||
/// <param name="before">The optional date to return threads created before this timestamp.</param>
|
|
||||||
/// <param name="options">The options to be used when sending the request.</param>
|
|
||||||
/// <returns>
|
|
||||||
/// A task that represents an asynchronous get operation for retrieving the threads. The task result contains
|
|
||||||
/// a collection of privately archived threads.
|
|
||||||
/// </returns>
|
|
||||||
Task<IReadOnlyCollection<IThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Discord
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a generic channel in a guild that can send and receive messages.
|
/// Represents a generic channel in a guild that can send and receive messages.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ITextChannel : IMessageChannel, IMentionable, INestedChannel, IIntegrationChannel
|
public interface ITextChannel : IMessageChannel, IMentionable, INestedChannel, IIntegrationChannel, IThreadContainerChannel
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a value that indicates whether the channel is NSFW.
|
/// Gets a value that indicates whether the channel is NSFW.
|
||||||
@@ -125,7 +125,7 @@ namespace Discord
|
|||||||
/// The duration on which this thread archives after.
|
/// The duration on which this thread archives after.
|
||||||
/// <para>
|
/// <para>
|
||||||
/// <b>Note: </b> Options <see cref="ThreadArchiveDuration.OneWeek"/> and <see cref="ThreadArchiveDuration.ThreeDays"/>
|
/// <b>Note: </b> Options <see cref="ThreadArchiveDuration.OneWeek"/> and <see cref="ThreadArchiveDuration.ThreeDays"/>
|
||||||
/// are only available for guilds that are boosted. You can check in the <see cref="IGuild.Features"/> to see if the
|
/// are only available for guilds that are boosted. You can check in the <see cref="IGuild.Features"/> to see if the
|
||||||
/// guild has the <b>THREE_DAY_THREAD_ARCHIVE</b> and <b>SEVEN_DAY_THREAD_ARCHIVE</b>.
|
/// guild has the <b>THREE_DAY_THREAD_ARCHIVE</b> and <b>SEVEN_DAY_THREAD_ARCHIVE</b>.
|
||||||
/// </para>
|
/// </para>
|
||||||
/// </param>
|
/// </param>
|
||||||
@@ -139,14 +139,5 @@ namespace Discord
|
|||||||
Task<IThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay,
|
Task<IThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay,
|
||||||
IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null);
|
IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a collection of active threads within this channel.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="options">The options to be used when sending the request.</param>
|
|
||||||
/// <returns>
|
|
||||||
/// A task that represents an asynchronous get operation for retrieving the threads. The task result contains
|
|
||||||
/// a collection of active threads.
|
|
||||||
/// </returns>
|
|
||||||
Task<IReadOnlyCollection<IThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Discord
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a channel that can contain and query threads.
|
||||||
|
/// </summary>
|
||||||
|
public interface IThreadContainerChannel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a collection of active threads within this channel.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="options">The options to be used when sending the request.</param>
|
||||||
|
/// <returns>
|
||||||
|
/// A task that represents an asynchronous get operation for retrieving the threads. The task result contains
|
||||||
|
/// a collection of active threads.
|
||||||
|
/// </returns>
|
||||||
|
Task<IReadOnlyCollection<IThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a collection of publicly archived threads within this channel.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="limit">The optional limit of how many to get.</param>
|
||||||
|
/// <param name="before">The optional date to return threads created before this timestamp.</param>
|
||||||
|
/// <param name="options">The options to be used when sending the request.</param>
|
||||||
|
/// <returns>
|
||||||
|
/// A task that represents an asynchronous get operation for retrieving the threads. The task result contains
|
||||||
|
/// a collection of publicly archived threads.
|
||||||
|
/// </returns>
|
||||||
|
Task<IReadOnlyCollection<IThreadChannel>> GetPublicArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a collection of privately archived threads within this channel.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// The bot requires the <see cref="GuildPermission.ManageThreads"/> permission in order to execute this request.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="limit">The optional limit of how many to get.</param>
|
||||||
|
/// <param name="before">The optional date to return threads created before this timestamp.</param>
|
||||||
|
/// <param name="options">The options to be used when sending the request.</param>
|
||||||
|
/// <returns>
|
||||||
|
/// A task that represents an asynchronous get operation for retrieving the threads. The task result contains
|
||||||
|
/// a collection of privately archived threads.
|
||||||
|
/// </returns>
|
||||||
|
Task<IReadOnlyCollection<IThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a collection of privately archived threads that the current bot has joined within this channel.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="limit">The optional limit of how many to get.</param>
|
||||||
|
/// <param name="before">The optional date to return threads created before this timestamp.</param>
|
||||||
|
/// <param name="options">The options to be used when sending the request.</param>
|
||||||
|
/// <returns>
|
||||||
|
/// A task that represents an asynchronous get operation for retrieving the threads. The task result contains
|
||||||
|
/// a collection of privately archived threads.
|
||||||
|
/// </returns>
|
||||||
|
Task<IReadOnlyCollection<IThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -138,22 +138,6 @@ namespace Discord.Rest
|
|||||||
MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = MessageFlags.None, ForumTag[] tags = null)
|
MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = MessageFlags.None, ForumTag[] tags = null)
|
||||||
=> ThreadHelper.CreatePostAsync(this, Discord, title, attachments, archiveDuration, slowmode, text, embed, options, allowedMentions, components, stickers, embeds, flags, tags?.Select(tag => tag.Id).ToArray());
|
=> ThreadHelper.CreatePostAsync(this, Discord, title, attachments, archiveDuration, slowmode, text, embed, options, allowedMentions, components, stickers, embeds, flags, tags?.Select(tag => tag.Id).ToArray());
|
||||||
|
|
||||||
/// <inheritdoc cref="ITextChannel.GetActiveThreadsAsync(RequestOptions)"/>
|
|
||||||
public Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
|
||||||
=> ThreadHelper.GetActiveThreadsAsync(Guild, Id, Discord, options);
|
|
||||||
|
|
||||||
/// <inheritdoc cref="IForumChannel.GetJoinedPrivateArchivedThreadsAsync(int?, DateTimeOffset?, RequestOptions)"/>
|
|
||||||
public Task<IReadOnlyCollection<RestThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null)
|
|
||||||
=> ThreadHelper.GetJoinedPrivateArchivedThreadsAsync(this, Discord, limit, before, options);
|
|
||||||
|
|
||||||
/// <inheritdoc cref="IForumChannel.GetPrivateArchivedThreadsAsync(int?, DateTimeOffset?, RequestOptions)"/>
|
|
||||||
public Task<IReadOnlyCollection<RestThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null)
|
|
||||||
=> ThreadHelper.GetPrivateArchivedThreadsAsync(this, Discord, limit, before, options);
|
|
||||||
|
|
||||||
/// <inheritdoc cref="IForumChannel.GetPublicArchivedThreadsAsync(int?, DateTimeOffset?, RequestOptions)"/>
|
|
||||||
public Task<IReadOnlyCollection<RestThreadChannel>> GetPublicArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null)
|
|
||||||
=> ThreadHelper.GetPublicArchivedThreadsAsync(this, Discord, limit, before, options);
|
|
||||||
|
|
||||||
/// <inheritdoc cref="IIntegrationChannel.CreateWebhookAsync"/>
|
/// <inheritdoc cref="IIntegrationChannel.CreateWebhookAsync"/>
|
||||||
public Task<RestWebhook> CreateWebhookAsync(string name, Stream avatar = null, RequestOptions options = null)
|
public Task<RestWebhook> CreateWebhookAsync(string name, Stream avatar = null, RequestOptions options = null)
|
||||||
=> ChannelHelper.CreateWebhookAsync(this, Discord, name, avatar, options);
|
=> ChannelHelper.CreateWebhookAsync(this, Discord, name, avatar, options);
|
||||||
@@ -167,14 +151,6 @@ namespace Discord.Rest
|
|||||||
=> ChannelHelper.GetWebhooksAsync(this, Discord, options);
|
=> ChannelHelper.GetWebhooksAsync(this, Discord, options);
|
||||||
|
|
||||||
#region IForumChannel
|
#region IForumChannel
|
||||||
async Task<IReadOnlyCollection<IThreadChannel>> IForumChannel.GetActiveThreadsAsync(RequestOptions options)
|
|
||||||
=> await GetActiveThreadsAsync(options).ConfigureAwait(false);
|
|
||||||
async Task<IReadOnlyCollection<IThreadChannel>> IForumChannel.GetPublicArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
|
||||||
=> await GetPublicArchivedThreadsAsync(limit, before, options).ConfigureAwait(false);
|
|
||||||
async Task<IReadOnlyCollection<IThreadChannel>> IForumChannel.GetPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
|
||||||
=> await GetPrivateArchivedThreadsAsync(limit, before, options).ConfigureAwait(false);
|
|
||||||
async Task<IReadOnlyCollection<IThreadChannel>> IForumChannel.GetJoinedPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
|
||||||
=> await GetJoinedPrivateArchivedThreadsAsync(limit, before, options).ConfigureAwait(false);
|
|
||||||
async Task<IThreadChannel> IForumChannel.CreatePostAsync(string title, ThreadArchiveDuration archiveDuration, int? slowmode, string text, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageComponent components, ISticker[] stickers, Embed[] embeds, MessageFlags flags, ForumTag[] tags)
|
async Task<IThreadChannel> IForumChannel.CreatePostAsync(string title, ThreadArchiveDuration archiveDuration, int? slowmode, string text, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageComponent components, ISticker[] stickers, Embed[] embeds, MessageFlags flags, ForumTag[] tags)
|
||||||
=> await CreatePostAsync(title, archiveDuration, slowmode, text, embed, options, allowedMentions, components, stickers, embeds, flags, tags).ConfigureAwait(false);
|
=> await CreatePostAsync(title, archiveDuration, slowmode, text, embed, options, allowedMentions, components, stickers, embeds, flags, tags).ConfigureAwait(false);
|
||||||
async Task<IThreadChannel> IForumChannel.CreatePostWithFileAsync(string title, string filePath, ThreadArchiveDuration archiveDuration, int? slowmode, string text, Embed embed, RequestOptions options, bool isSpoiler, AllowedMentions allowedMentions, MessageComponent components, ISticker[] stickers, Embed[] embeds, MessageFlags flags, ForumTag[] tags)
|
async Task<IThreadChannel> IForumChannel.CreatePostWithFileAsync(string title, string filePath, ThreadArchiveDuration archiveDuration, int? slowmode, string text, Embed embed, RequestOptions options, bool isSpoiler, AllowedMentions allowedMentions, MessageComponent components, ISticker[] stickers, Embed[] embeds, MessageFlags flags, ForumTag[] tags)
|
||||||
@@ -230,5 +206,32 @@ namespace Discord.Rest
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region IThreadContainerChannel
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetActiveThreadsAsync(RequestOptions)"/>
|
||||||
|
public Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
||||||
|
=> ThreadHelper.GetActiveThreadsAsync(Guild, Id, Discord, options);
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetJoinedPrivateArchivedThreadsAsync(int?, DateTimeOffset?, RequestOptions)"/>
|
||||||
|
public Task<IReadOnlyCollection<RestThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null)
|
||||||
|
=> ThreadHelper.GetJoinedPrivateArchivedThreadsAsync(this, Discord, limit, before, options);
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetPrivateArchivedThreadsAsync(int?, DateTimeOffset?, RequestOptions)"/>
|
||||||
|
public Task<IReadOnlyCollection<RestThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null)
|
||||||
|
=> ThreadHelper.GetPrivateArchivedThreadsAsync(this, Discord, limit, before, options);
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetPublicArchivedThreadsAsync(int?, DateTimeOffset?, RequestOptions)"/>
|
||||||
|
public Task<IReadOnlyCollection<RestThreadChannel>> GetPublicArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null)
|
||||||
|
=> ThreadHelper.GetPublicArchivedThreadsAsync(this, Discord, limit, before, options);
|
||||||
|
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetActiveThreadsAsync(RequestOptions options)
|
||||||
|
=> await GetActiveThreadsAsync(options).ConfigureAwait(false);
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetPublicArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> await GetPublicArchivedThreadsAsync(limit, before, options).ConfigureAwait(false);
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> await GetPrivateArchivedThreadsAsync(limit, before, options).ConfigureAwait(false);
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetJoinedPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> await GetJoinedPrivateArchivedThreadsAsync(limit, before, options).ConfigureAwait(false);
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,10 +287,6 @@ namespace Discord.Rest
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Task SyncPermissionsAsync(RequestOptions options = null)
|
public Task SyncPermissionsAsync(RequestOptions options = null)
|
||||||
=> ChannelHelper.SyncPermissionsAsync(this, Discord, options);
|
=> ChannelHelper.SyncPermissionsAsync(this, Discord, options);
|
||||||
|
|
||||||
/// <inheritdoc cref="ITextChannel.GetActiveThreadsAsync(RequestOptions)"/>
|
|
||||||
public virtual Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
|
||||||
=> ThreadHelper.GetActiveThreadsAsync(Guild, Id, Discord, options);
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Invites
|
#region Invites
|
||||||
@@ -329,10 +325,6 @@ namespace Discord.Rest
|
|||||||
|
|
||||||
async Task<IThreadChannel> ITextChannel.CreateThreadAsync(string name, ThreadType type, ThreadArchiveDuration autoArchiveDuration, IMessage message, bool? invitable, int? slowmode, RequestOptions options)
|
async Task<IThreadChannel> ITextChannel.CreateThreadAsync(string name, ThreadType type, ThreadArchiveDuration autoArchiveDuration, IMessage message, bool? invitable, int? slowmode, RequestOptions options)
|
||||||
=> await CreateThreadAsync(name, type, autoArchiveDuration, message, invitable, slowmode, options);
|
=> await CreateThreadAsync(name, type, autoArchiveDuration, message, invitable, slowmode, options);
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
async Task<IReadOnlyCollection<IThreadChannel>> ITextChannel.GetActiveThreadsAsync(RequestOptions options)
|
|
||||||
=> await GetActiveThreadsAsync(options);
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IMessageChannel
|
#region IMessageChannel
|
||||||
@@ -453,5 +445,31 @@ namespace Discord.Rest
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region IThreadContainerChannel
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetActiveThreadsAsync(RequestOptions)"/>
|
||||||
|
public virtual Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
||||||
|
=> ThreadHelper.GetActiveThreadsAsync(Guild, Id, Discord, options);
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetPublicArchivedThreadsAsync(int?,System.DateTimeOffset?,RequestOptions)"/>
|
||||||
|
public virtual Task<IReadOnlyCollection<RestThreadChannel>> GetPublicArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> ThreadHelper.GetPublicArchivedThreadsAsync(this, Discord, limit, before, options);
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetPrivateArchivedThreadsAsync(int?,System.DateTimeOffset?,RequestOptions)"/>
|
||||||
|
public virtual Task<IReadOnlyCollection<RestThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> ThreadHelper.GetPrivateArchivedThreadsAsync(this, Discord, limit, before, options);
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetJoinedPrivateArchivedThreadsAsync(int?,System.DateTimeOffset?,RequestOptions)"/>
|
||||||
|
public virtual Task<IReadOnlyCollection<RestThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> ThreadHelper.GetJoinedPrivateArchivedThreadsAsync(this, Discord, limit, before, options);
|
||||||
|
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetActiveThreadsAsync(RequestOptions options)
|
||||||
|
=> await GetActiveThreadsAsync(options);
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetPublicArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> await GetPublicArchivedThreadsAsync(limit, before, options);
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> await GetPrivateArchivedThreadsAsync(limit, before, options);
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetJoinedPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> await GetJoinedPrivateArchivedThreadsAsync(limit, before, options);
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,5 +262,29 @@ namespace Discord.Rest
|
|||||||
/// <inheritdoc/> <exception cref="NotSupportedException">This method is not supported in threads.</exception>
|
/// <inheritdoc/> <exception cref="NotSupportedException">This method is not supported in threads.</exception>
|
||||||
public override Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
||||||
=> throw new NotSupportedException("This method is not supported in threads.");
|
=> throw new NotSupportedException("This method is not supported in threads.");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <remarks>
|
||||||
|
/// This method is not supported in threads.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="NotSupportedException">This method is not supported in threads.</exception>
|
||||||
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetPublicArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> throw new NotSupportedException("This method is not supported in threads.");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <remarks>
|
||||||
|
/// This method is not supported in threads.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="NotSupportedException">This method is not supported in threads.</exception>
|
||||||
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> throw new NotSupportedException("This method is not supported in threads.");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <remarks>
|
||||||
|
/// This method is not supported in threads.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="NotSupportedException">This method is not supported in threads.</exception>
|
||||||
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> throw new NotSupportedException("This method is not supported in threads.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,30 @@ namespace Discord.Rest
|
|||||||
public override Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
||||||
=> throw new NotSupportedException("Threads are not supported in voice channels");
|
=> throw new NotSupportedException("Threads are not supported in voice channels");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <remarks>
|
||||||
|
/// Threads are not supported in voice channels
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="NotSupportedException">Threads are not supported in voice channels</exception>
|
||||||
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetPublicArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> throw new NotSupportedException("Threads are not supported in voice channels");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <remarks>
|
||||||
|
/// Threads are not supported in voice channels
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="NotSupportedException">Threads are not supported in voice channels</exception>
|
||||||
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> throw new NotSupportedException("Threads are not supported in voice channels");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <remarks>
|
||||||
|
/// Threads are not supported in voice channels.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="NotSupportedException">Threads are not supported in voice channels</exception>
|
||||||
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> throw new NotSupportedException("Threads are not supported in voice channels");
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -140,22 +140,6 @@ namespace Discord.WebSocket
|
|||||||
MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = MessageFlags.None, ForumTag[] tags = null)
|
MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = MessageFlags.None, ForumTag[] tags = null)
|
||||||
=> ThreadHelper.CreatePostAsync(this, Discord, title, attachments, archiveDuration, slowmode, text, embed, options, allowedMentions, components, stickers, embeds, flags, tags?.Select(tag => tag.Id).ToArray());
|
=> ThreadHelper.CreatePostAsync(this, Discord, title, attachments, archiveDuration, slowmode, text, embed, options, allowedMentions, components, stickers, embeds, flags, tags?.Select(tag => tag.Id).ToArray());
|
||||||
|
|
||||||
/// <inheritdoc cref="ITextChannel.GetActiveThreadsAsync(RequestOptions)"/>
|
|
||||||
public Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
|
||||||
=> ThreadHelper.GetActiveThreadsAsync(Guild, Id, Discord, options);
|
|
||||||
|
|
||||||
/// <inheritdoc cref="IForumChannel.GetJoinedPrivateArchivedThreadsAsync(int?, DateTimeOffset?, RequestOptions)"/>
|
|
||||||
public Task<IReadOnlyCollection<RestThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null)
|
|
||||||
=> ThreadHelper.GetJoinedPrivateArchivedThreadsAsync(this, Discord, limit, before, options);
|
|
||||||
|
|
||||||
/// <inheritdoc cref="IForumChannel.GetPrivateArchivedThreadsAsync(int?, DateTimeOffset?, RequestOptions)"/>
|
|
||||||
public Task<IReadOnlyCollection<RestThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null)
|
|
||||||
=> ThreadHelper.GetPrivateArchivedThreadsAsync(this, Discord, limit, before, options);
|
|
||||||
|
|
||||||
/// <inheritdoc cref="IForumChannel.GetPublicArchivedThreadsAsync(int?, DateTimeOffset?, RequestOptions)"/>
|
|
||||||
public Task<IReadOnlyCollection<RestThreadChannel>> GetPublicArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null)
|
|
||||||
=> ThreadHelper.GetPublicArchivedThreadsAsync(this, Discord, limit, before, options);
|
|
||||||
|
|
||||||
#region Webhooks
|
#region Webhooks
|
||||||
|
|
||||||
/// <inheritdoc cref="IIntegrationChannel.CreateWebhookAsync"/>
|
/// <inheritdoc cref="IIntegrationChannel.CreateWebhookAsync"/>
|
||||||
@@ -186,15 +170,6 @@ namespace Discord.WebSocket
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IForumChannel
|
#region IForumChannel
|
||||||
async Task<IReadOnlyCollection<IThreadChannel>> IForumChannel.GetActiveThreadsAsync(RequestOptions options)
|
|
||||||
=> await GetActiveThreadsAsync(options).ConfigureAwait(false);
|
|
||||||
async Task<IReadOnlyCollection<IThreadChannel>> IForumChannel.GetPublicArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
|
||||||
=> await GetPublicArchivedThreadsAsync(limit, before, options).ConfigureAwait(false);
|
|
||||||
async Task<IReadOnlyCollection<IThreadChannel>> IForumChannel.GetPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
|
||||||
=> await GetPrivateArchivedThreadsAsync(limit, before, options).ConfigureAwait(false);
|
|
||||||
async Task<IReadOnlyCollection<IThreadChannel>> IForumChannel.GetJoinedPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
|
||||||
=> await GetJoinedPrivateArchivedThreadsAsync(limit, before, options).ConfigureAwait(false);
|
|
||||||
|
|
||||||
async Task<IThreadChannel> IForumChannel.CreatePostAsync(string title, ThreadArchiveDuration archiveDuration, int? slowmode, string text, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageComponent components, ISticker[] stickers, Embed[] embeds, MessageFlags flags, ForumTag[] tags)
|
async Task<IThreadChannel> IForumChannel.CreatePostAsync(string title, ThreadArchiveDuration archiveDuration, int? slowmode, string text, Embed embed, RequestOptions options, AllowedMentions allowedMentions, MessageComponent components, ISticker[] stickers, Embed[] embeds, MessageFlags flags, ForumTag[] tags)
|
||||||
=> await CreatePostAsync(title, archiveDuration, slowmode, text, embed, options, allowedMentions, components, stickers, embeds, flags, tags).ConfigureAwait(false);
|
=> await CreatePostAsync(title, archiveDuration, slowmode, text, embed, options, allowedMentions, components, stickers, embeds, flags, tags).ConfigureAwait(false);
|
||||||
async Task<IThreadChannel> IForumChannel.CreatePostWithFileAsync(string title, string filePath, ThreadArchiveDuration archiveDuration, int? slowmode, string text, Embed embed, RequestOptions options, bool isSpoiler, AllowedMentions allowedMentions, MessageComponent components, ISticker[] stickers, Embed[] embeds, MessageFlags flags, ForumTag[] tags)
|
async Task<IThreadChannel> IForumChannel.CreatePostWithFileAsync(string title, string filePath, ThreadArchiveDuration archiveDuration, int? slowmode, string text, Embed embed, RequestOptions options, bool isSpoiler, AllowedMentions allowedMentions, MessageComponent components, ISticker[] stickers, Embed[] embeds, MessageFlags flags, ForumTag[] tags)
|
||||||
@@ -231,5 +206,32 @@ namespace Discord.WebSocket
|
|||||||
public virtual Task SyncPermissionsAsync(RequestOptions options = null)
|
public virtual Task SyncPermissionsAsync(RequestOptions options = null)
|
||||||
=> ChannelHelper.SyncPermissionsAsync(this, Discord, options);
|
=> ChannelHelper.SyncPermissionsAsync(this, Discord, options);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region IThreadContainerChannel
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetActiveThreadsAsync(RequestOptions)"/>
|
||||||
|
public Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
||||||
|
=> ThreadHelper.GetActiveThreadsAsync(Guild, Id, Discord, options);
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetJoinedPrivateArchivedThreadsAsync(int?, DateTimeOffset?, RequestOptions)"/>
|
||||||
|
public Task<IReadOnlyCollection<RestThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null)
|
||||||
|
=> ThreadHelper.GetJoinedPrivateArchivedThreadsAsync(this, Discord, limit, before, options);
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetPrivateArchivedThreadsAsync(int?, DateTimeOffset?, RequestOptions)"/>
|
||||||
|
public Task<IReadOnlyCollection<RestThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null)
|
||||||
|
=> ThreadHelper.GetPrivateArchivedThreadsAsync(this, Discord, limit, before, options);
|
||||||
|
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetPublicArchivedThreadsAsync(int?, DateTimeOffset?, RequestOptions)"/>
|
||||||
|
public Task<IReadOnlyCollection<RestThreadChannel>> GetPublicArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null)
|
||||||
|
=> ThreadHelper.GetPublicArchivedThreadsAsync(this, Discord, limit, before, options);
|
||||||
|
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetActiveThreadsAsync(RequestOptions options)
|
||||||
|
=> await GetActiveThreadsAsync(options).ConfigureAwait(false);
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetPublicArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> await GetPublicArchivedThreadsAsync(limit, before, options).ConfigureAwait(false);
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> await GetPrivateArchivedThreadsAsync(limit, before, options).ConfigureAwait(false);
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetJoinedPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> await GetJoinedPrivateArchivedThreadsAsync(limit, before, options).ConfigureAwait(false);
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,11 +129,6 @@ namespace Discord.WebSocket
|
|||||||
|
|
||||||
return thread;
|
return thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc cref="ITextChannel.GetActiveThreadsAsync(RequestOptions)"/>
|
|
||||||
public virtual Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
|
||||||
=> ThreadHelper.GetActiveThreadsAsync(Guild, Id, Discord, options);
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Messages
|
#region Messages
|
||||||
@@ -386,9 +381,6 @@ namespace Discord.WebSocket
|
|||||||
#region ITextChannel
|
#region ITextChannel
|
||||||
async Task<IThreadChannel> ITextChannel.CreateThreadAsync(string name, ThreadType type, ThreadArchiveDuration autoArchiveDuration, IMessage message, bool? invitable, int? slowmode, RequestOptions options)
|
async Task<IThreadChannel> ITextChannel.CreateThreadAsync(string name, ThreadType type, ThreadArchiveDuration autoArchiveDuration, IMessage message, bool? invitable, int? slowmode, RequestOptions options)
|
||||||
=> await CreateThreadAsync(name, type, autoArchiveDuration, message, invitable, slowmode, options);
|
=> await CreateThreadAsync(name, type, autoArchiveDuration, message, invitable, slowmode, options);
|
||||||
/// <inheritdoc />
|
|
||||||
async Task<IReadOnlyCollection<IThreadChannel>> ITextChannel.GetActiveThreadsAsync(RequestOptions options)
|
|
||||||
=> await GetActiveThreadsAsync(options);
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IGuildChannel
|
#region IGuildChannel
|
||||||
@@ -468,6 +460,31 @@ namespace Discord.WebSocket
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region IThreadContainerChannel
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetActiveThreadsAsync(RequestOptions)"/>
|
||||||
|
public virtual Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
||||||
|
=> ThreadHelper.GetActiveThreadsAsync(Guild, Id, Discord, options);
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetPublicArchivedThreadsAsync(int?,System.DateTimeOffset?,RequestOptions)"/>
|
||||||
|
public virtual Task<IReadOnlyCollection<RestThreadChannel>> GetPublicArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> ThreadHelper.GetPublicArchivedThreadsAsync(this, Discord, limit, before, options);
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetPrivateArchivedThreadsAsync(int?,System.DateTimeOffset?,RequestOptions)"/>
|
||||||
|
public virtual Task<IReadOnlyCollection<RestThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> ThreadHelper.GetPrivateArchivedThreadsAsync(this, Discord, limit, before, options);
|
||||||
|
/// <inheritdoc cref="IThreadContainerChannel.GetJoinedPrivateArchivedThreadsAsync(int?,System.DateTimeOffset?,RequestOptions)"/>
|
||||||
|
public virtual Task<IReadOnlyCollection<RestThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> ThreadHelper.GetJoinedPrivateArchivedThreadsAsync(this, Discord, limit, before, options);
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetActiveThreadsAsync(RequestOptions options)
|
||||||
|
=> await GetActiveThreadsAsync(options);
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetPublicArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> await GetPublicArchivedThreadsAsync(limit, before, options);
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> await GetPrivateArchivedThreadsAsync(limit, before, options);
|
||||||
|
async Task<IReadOnlyCollection<IThreadChannel>> IThreadContainerChannel.GetJoinedPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> await GetJoinedPrivateArchivedThreadsAsync(limit, before, options);
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region INestedChannel
|
#region INestedChannel
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options)
|
Task<ICategoryChannel> INestedChannel.GetCategoryAsync(CacheMode mode, RequestOptions options)
|
||||||
|
|||||||
@@ -387,6 +387,30 @@ namespace Discord.WebSocket
|
|||||||
public override Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
||||||
=> throw new NotSupportedException("This method is not supported in threads.");
|
=> throw new NotSupportedException("This method is not supported in threads.");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <remarks>
|
||||||
|
/// This method is not supported in threads.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="NotSupportedException">This method is not supported in threads.</exception>
|
||||||
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetPublicArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> throw new NotSupportedException("This method is not supported in threads.");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <remarks>
|
||||||
|
/// This method is not supported in threads.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="NotSupportedException">This method is not supported in threads.</exception>
|
||||||
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> throw new NotSupportedException("This method is not supported in threads.");
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <remarks>
|
||||||
|
/// This method is not supported in threads.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="NotSupportedException">This method is not supported in threads.</exception>
|
||||||
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> throw new NotSupportedException("This method is not supported in threads.");
|
||||||
|
|
||||||
string IChannel.Name => Name;
|
string IChannel.Name => Name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ namespace Discord.WebSocket
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Task ModifyAsync(Action<AudioChannelProperties> func, RequestOptions options = null)
|
public Task ModifyAsync(Action<AudioChannelProperties> func, RequestOptions options = null)
|
||||||
=> Guild.ModifyAudioAsync(Id, func, options);
|
=> Guild.ModifyAudioAsync(Id, func, options);
|
||||||
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override SocketGuildUser GetUser(ulong id)
|
public override SocketGuildUser GetUser(ulong id)
|
||||||
@@ -121,7 +121,27 @@ namespace Discord.WebSocket
|
|||||||
/// <inheritdoc/> <exception cref="NotSupportedException">Threads are not supported in voice channels</exception>
|
/// <inheritdoc/> <exception cref="NotSupportedException">Threads are not supported in voice channels</exception>
|
||||||
public override Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
|
||||||
=> throw new NotSupportedException("Threads are not supported in voice channels");
|
=> throw new NotSupportedException("Threads are not supported in voice channels");
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <remarks>
|
||||||
|
/// Threads are not supported in voice channels
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="NotSupportedException">Threads are not supported in voice channels</exception>
|
||||||
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetPublicArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> throw new NotSupportedException("Threads are not supported in voice channels");
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <remarks>
|
||||||
|
/// Threads are not supported in voice channels
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="NotSupportedException">Threads are not supported in voice channels</exception>
|
||||||
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> throw new NotSupportedException("Threads are not supported in voice channels");
|
||||||
|
/// <inheritdoc />
|
||||||
|
/// <remarks>
|
||||||
|
/// Threads are not supported in voice channels.
|
||||||
|
/// </remarks>
|
||||||
|
/// <exception cref="NotSupportedException">Threads are not supported in voice channels</exception>
|
||||||
|
public override Task<IReadOnlyCollection<RestThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit, DateTimeOffset? before, RequestOptions options)
|
||||||
|
=> throw new NotSupportedException("Threads are not supported in voice channels");
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private string DebuggerDisplay => $"{Name} ({Id}, Voice)";
|
private string DebuggerDisplay => $"{Name} ({Id}, Voice)";
|
||||||
|
|||||||
@@ -224,5 +224,8 @@ namespace Discord
|
|||||||
public Task<IInviteMetadata> CreateInviteToApplicationAsync(DefaultApplications application, int? maxAge = 86400, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null) => throw new NotImplementedException();
|
public Task<IInviteMetadata> CreateInviteToApplicationAsync(DefaultApplications application, int? maxAge = 86400, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null) => throw new NotImplementedException();
|
||||||
public Task<IThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay, IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null) => throw new NotImplementedException();
|
public Task<IThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay, IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null) => throw new NotImplementedException();
|
||||||
public Task<IReadOnlyCollection<IThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null) => throw new NotImplementedException();
|
public Task<IReadOnlyCollection<IThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null) => throw new NotImplementedException();
|
||||||
|
public Task<IReadOnlyCollection<IThreadChannel>> GetPublicArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null) => throw new NotImplementedException();
|
||||||
|
public Task<IReadOnlyCollection<IThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null) => throw new NotImplementedException();
|
||||||
|
public Task<IReadOnlyCollection<IThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null) => throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ namespace Discord
|
|||||||
public Task<IThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay, IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null) => throw new NotImplementedException();
|
public Task<IThreadChannel> CreateThreadAsync(string name, ThreadType type = ThreadType.PublicThread, ThreadArchiveDuration autoArchiveDuration = ThreadArchiveDuration.OneDay, IMessage message = null, bool? invitable = null, int? slowmode = null, RequestOptions options = null) => throw new NotImplementedException();
|
||||||
|
|
||||||
public Task<IReadOnlyCollection<IThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null) => throw new NotImplementedException();
|
public Task<IReadOnlyCollection<IThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null) => throw new NotImplementedException();
|
||||||
|
public Task<IReadOnlyCollection<IThreadChannel>> GetPublicArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null) => throw new NotImplementedException();
|
||||||
|
public Task<IReadOnlyCollection<IThreadChannel>> GetPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null) => throw new NotImplementedException();
|
||||||
|
public Task<IReadOnlyCollection<IThreadChannel>> GetJoinedPrivateArchivedThreadsAsync(int? limit = null, DateTimeOffset? before = null, RequestOptions options = null) => throw new NotImplementedException();
|
||||||
|
|
||||||
public ulong? CategoryId => throw new NotImplementedException();
|
public ulong? CategoryId => throw new NotImplementedException();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user