pub struct ThreadManager<'a, B: Backend> { /* private fields */ }Expand description
The threads of one parent channel: creating them and listing the archived ones.
Returned by Context::threads.
A thread is a channel: edit or delete it through Context::channels
(edit_thread, delete),
and list a guild’s active threads with
GuildChannelManager::list_active_threads.
discord.js counterpart: GuildTextThreadManager / GuildForumThreadManager
(channel.threads).
Implementations§
Source§impl<'a, B: Backend> ThreadManager<'a, B>
impl<'a, B: Backend> ThreadManager<'a, B>
Sourcepub const fn channel_id(self) -> ChannelId
pub const fn channel_id(self) -> ChannelId
The parent channel.
discord.js counterpart: ThreadManager#channel.
Sourcepub async fn create(
self,
body: &StartThreadWithoutMessage,
reason: Option<&str>,
) -> Result<Arc<Channel>, Error>
pub async fn create( self, body: &StartThreadWithoutMessage, reason: Option<&str>, ) -> Result<Arc<Channel>, Error>
Starts a thread without a message (Start Thread without Message); it is cached.
discord.js counterpart: GuildTextThreadManager#create.
§Errors
Returns the REST error if the request failed (it needs CREATE_PUBLIC_THREADS or
CREATE_PRIVATE_THREADS).
Sourcepub async fn create_in_forum(
self,
body: &StartThreadInForumOrMediaChannel,
reason: Option<&str>,
) -> Result<Arc<Channel>, Error>
pub async fn create_in_forum( self, body: &StartThreadInForumOrMediaChannel, reason: Option<&str>, ) -> Result<Arc<Channel>, Error>
Starts a post in a forum or media channel (Start Thread in Forum or Media Channel). The thread and its starter message (whose ID is the thread’s) are cached.
discord.js counterpart: GuildForumThreadManager#create.
§Errors
Returns the REST error if the request failed (it needs SEND_MESSAGES).
Sourcepub async fn list_public_archived(
self,
query: &ListArchivedThreads,
) -> Result<FetchedThreads, Error>
pub async fn list_public_archived( self, query: &ListArchivedThreads, ) -> Result<FetchedThreads, Error>
Archived public threads, newest first (List Public Archived Threads).
discord.js counterpart: GuildTextThreadManager#fetchArchived({ type: 'public' }).
§Errors
Returns the REST error if the request failed (it needs READ_MESSAGE_HISTORY).
Sourcepub async fn list_private_archived(
self,
query: &ListArchivedThreads,
) -> Result<FetchedThreads, Error>
pub async fn list_private_archived( self, query: &ListArchivedThreads, ) -> Result<FetchedThreads, Error>
Archived private threads, newest first (List Private Archived Threads).
discord.js counterpart: GuildTextThreadManager#fetchArchived({ type: 'private' }).
§Errors
Returns the REST error if the request failed (it needs READ_MESSAGE_HISTORY and
MANAGE_THREADS).
Sourcepub async fn list_joined_private_archived(
self,
query: &ListJoinedPrivateArchivedThreads,
) -> Result<FetchedThreads, Error>
pub async fn list_joined_private_archived( self, query: &ListJoinedPrivateArchivedThreads, ) -> Result<FetchedThreads, Error>
Archived private threads the bot joined, newest first (List Joined Private Archived Threads).
discord.js counterpart: GuildTextThreadManager#fetchArchived({ type: 'private', fetchAll: false }).
§Errors
Returns the REST error if the request failed.
Trait Implementations§
Source§impl<B: Backend> Clone for ThreadManager<'_, B>
impl<B: Backend> Clone for ThreadManager<'_, B>
impl<B: Backend> Copy for ThreadManager<'_, B>
Auto Trait Implementations§
impl<'a, B> !RefUnwindSafe for ThreadManager<'a, B>
impl<'a, B> !UnwindSafe for ThreadManager<'a, B>
impl<'a, B> Freeze for ThreadManager<'a, B>
impl<'a, B> Send for ThreadManager<'a, B>
impl<'a, B> Sync for ThreadManager<'a, B>
impl<'a, B> Unpin for ThreadManager<'a, B>
impl<'a, B> UnsafeUnpin for ThreadManager<'a, B>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more