pub struct CreateThread<'a> { /* private fields */ }
Expand description
Discord docs:
Implementations§
Source§impl<'a> CreateThread<'a>
impl<'a> CreateThread<'a>
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Creates a builder with the given thread name, leaving all other fields empty.
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
The name of the thread. Replaces the current value as set in Self::new
.
Note: Must be between 2 and 100 characters long.
Sourcepub fn auto_archive_duration(self, duration: AutoArchiveDuration) -> Self
pub fn auto_archive_duration(self, duration: AutoArchiveDuration) -> Self
Duration in minutes to automatically archive the thread after recent activity.
Sourcepub fn rate_limit_per_user(self, seconds: u16) -> Self
pub fn rate_limit_per_user(self, seconds: u16) -> Self
How many seconds must a user wait before sending another message.
Bots, or users with the MANAGE_MESSAGES
and/or MANAGE_CHANNELS
permissions are
exempt from this restriction.
Note: Must be between 0 and 21600 seconds (360 minutes or 6 hours).
Sourcepub fn invitable(self, invitable: bool) -> Self
pub fn invitable(self, invitable: bool) -> Self
Whether or not non-moderators can add other non-moderators to a thread.
Sourcepub fn kind(self, kind: ChannelType) -> Self
pub fn kind(self, kind: ChannelType) -> Self
The thread type, either ChannelType::PublicThread
or ChannelType::PrivateThread
.
Note: This field is ignored for message threads, and defaults to
ChannelType::PrivateThread
for standalone threads in order to match the behavior when
thread documentation was first published. This is a bit of a weird default though, and
thus is highly likely to change in the future, so it is recommended to always explicitly
setting it to avoid any breaking change.
Sourcepub fn audit_log_reason(self, reason: &'a str) -> Self
pub fn audit_log_reason(self, reason: &'a str) -> Self
Sets the request’s audit log reason.
Trait Implementations§
Source§impl Builder for CreateThread<'_>
impl Builder for CreateThread<'_>
Source§fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<GuildChannel>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<GuildChannel>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a thread, either private or public. Public threads require a message to connect the thread to.
§Errors
Returns Error::Http
if the current user lacks permission, or if invalid data is given.
Source§type Context<'ctx> = (ChannelId, Option<MessageId>)
type Context<'ctx> = (ChannelId, Option<MessageId>)
type Built = GuildChannel
Source§impl<'a> Clone for CreateThread<'a>
impl<'a> Clone for CreateThread<'a>
Source§fn clone(&self) -> CreateThread<'a>
fn clone(&self) -> CreateThread<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more