#[non_exhaustive]pub struct StartThreadInForumOrMediaChannel {
pub name: CompactString,
pub auto_archive_duration: Option<AutoArchiveDuration>,
pub rate_limit_per_user: Option<u16>,
pub message: ForumThreadMessage,
pub applied_tags: Vec<TagId>,
}Expand description
The body of Start Thread in Forum or Media Channel: a post with its first message.
The files of the message are uploaded with it.
discord.js counterpart: GuildForumThreadCreateOptions.
§Examples
use djs_model::rest::{ForumThreadMessage, StartThreadInForumOrMediaChannel};
let body = StartThreadInForumOrMediaChannel::new("Bug: crash", ForumThreadMessage::from("It crashes"));
assert_eq!(
serde_json::to_string(&body).unwrap(),
r#"{"name":"Bug: crash","message":{"content":"It crashes"}}"#
);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: CompactStringThe name (1-100 characters).
auto_archive_duration: Option<AutoArchiveDuration>The inactivity after which the thread is archived.
rate_limit_per_user: Option<u16>Slowmode: seconds a member must wait between messages (0-21600).
message: ForumThreadMessageThe first message.
The tags of the post (max 5).
Implementations§
Source§impl StartThreadInForumOrMediaChannel
impl StartThreadInForumOrMediaChannel
Sourcepub fn new(name: impl Into<CompactString>, message: ForumThreadMessage) -> Self
pub fn new(name: impl Into<CompactString>, message: ForumThreadMessage) -> Self
A post named name starting with message.
discord.js counterpart: GuildForumThreadCreateOptions.
Trait Implementations§
impl StructuralPartialEq for StartThreadInForumOrMediaChannel
Auto Trait Implementations§
impl Freeze for StartThreadInForumOrMediaChannel
impl RefUnwindSafe for StartThreadInForumOrMediaChannel
impl Send for StartThreadInForumOrMediaChannel
impl Sync for StartThreadInForumOrMediaChannel
impl Unpin for StartThreadInForumOrMediaChannel
impl UnsafeUnpin for StartThreadInForumOrMediaChannel
impl UnwindSafe for StartThreadInForumOrMediaChannel
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
Mutably borrows from an owned value. Read more