public static Task <IReadOnlyList <IThreadChannel> > FetchJoinedPrivateArchivedThreadsAsync(this ITextChannel channel, int limit = Discord.Limits.Rest.FetchThreadsPageSize, Snowflake?startFromId = null, IRestRequestOptions options = null, CancellationToken cancellationToken = default) { var client = channel.GetRestClient(); return(client.FetchJoinedPrivateArchivedThreadsAsync(channel.Id, limit, startFromId, options, cancellationToken)); }
public static IPagedEnumerable <IThreadChannel> EnumerateJoinedPrivateArchivedThreads(this ITextChannel channel, int limit, Snowflake?startFromId = null, IRestRequestOptions options = null) { var client = channel.GetRestClient(); return(client.EnumerateJoinedPrivateArchivedThreads(channel.Id, limit, startFromId, options)); }
public static IPagedEnumerable <IThreadChannel> EnumeratePrivateArchivedThreads(this ITextChannel channel, int limit, DateTimeOffset?startFromDate = null, IRestRequestOptions options = null) { var client = channel.GetRestClient(); return(client.EnumeratePrivateArchivedThreads(channel.Id, limit, startFromDate, options)); }
public static Task <IThreadChannel> CreatePrivateThreadAsync(this ITextChannel channel, string name, TimeSpan?automaticArchiveDuration = null, bool?allowInvitation = null, IRestRequestOptions options = null, CancellationToken cancellationToken = default) { var client = channel.GetRestClient(); return(client.CreatePrivateThreadAsync(channel.Id, name, automaticArchiveDuration, allowInvitation, options, cancellationToken)); }
/* * Threads */ public static Task <IThreadChannel> CreatePublicThreadAsync(this ITextChannel channel, string name, Snowflake?messageId = null, TimeSpan?automaticArchiveDuration = null, IRestRequestOptions options = null, CancellationToken cancellationToken = default) { var client = channel.GetRestClient(); return(client.CreatePublicThreadAsync(channel.Id, name, messageId, automaticArchiveDuration, options, cancellationToken)); }
public static Task <ITextChannel> ModifyAsync(this ITextChannel channel, Action <ModifyTextChannelActionProperties> action, IRestRequestOptions options = null, CancellationToken cancellationToken = default) { var client = channel.GetRestClient(); return(client.ModifyTextChannelAsync(channel.Id, action, options, cancellationToken)); }
public static Task <IUserMessage> CrosspostMessageAsync(this ITextChannel channel, Snowflake messageId, IRestRequestOptions options = null) { if (!channel.IsNews) { throw new ArgumentException("This text channel must be a news channel to have messages crossposted from it.", nameof(channel)); } var client = channel.GetRestClient(); return(client.CrosspostMessageAsync(channel.Id, messageId, options)); }
public static Task <IFollowedChannel> FollowAsync(this ITextChannel channel, Snowflake targetChannelId, IRestRequestOptions options = null) { if (!channel.IsNews) { throw new ArgumentException("This text channel must be a news channel to follow it.", nameof(channel)); } var client = channel.GetRestClient(); return(client.FollowNewsChannelAsync(channel.Id, targetChannelId, options)); }
public static Task <IReadOnlyList <IThreadChannel> > FetchJoinedPrivateArchivedThreadsAsync(this ITextChannel channel, int limit = 100, Snowflake?startFromId = null, IRestRequestOptions options = null) { var client = channel.GetRestClient(); return(client.FetchJoinedPrivateArchivedThreadsAsync(channel.Id, limit, startFromId, options)); }
public static Task <IReadOnlyList <IThreadChannel> > FetchPrivateArchivedThreadsAsync(this ITextChannel channel, int limit = 100, DateTimeOffset?startFromDate = null, IRestRequestOptions options = null) { var client = channel.GetRestClient(); return(client.FetchPrivateArchivedThreadsAsync(channel.Id, limit, startFromDate, options)); }
public static Task <IThreadChannel> CreatePrivateThreadAsync(this ITextChannel channel, string name, TimeSpan?automaticArchiveDuration = null, IRestRequestOptions options = null) { var client = channel.GetRestClient(); return(client.CreatePrivateThreadAsync(channel.Id, name, automaticArchiveDuration, options)); }
public static Task DeleteMessagesAsync(this ITextChannel channel, IEnumerable <Snowflake> messageIds, IRestRequestOptions options = null) { var client = channel.GetRestClient(); return(client.DeleteMessagesAsync(channel.Id, messageIds, options)); }
public static IPagedEnumerable <Snowflake> EnumerateMessageDeletion(this ITextChannel channel, IEnumerable <Snowflake> messageIds, IRestRequestOptions options = null) { var client = channel.GetRestClient(); return(client.EnumerateMessageDeletion(channel.Id, messageIds, options)); }