code
stringlengths
40
729k
docstring
stringlengths
22
46.3k
func_name
stringlengths
1
97
language
stringclasses
1 value
repo
stringlengths
6
48
path
stringlengths
8
176
url
stringlengths
47
228
license
stringclasses
7 values
pub fn message(self, name: &'a str) -> CreateGuildMessageCommand<'a> { CreateGuildMessageCommand::new(self.http, self.application_id, self.guild_id, name) }
Create a message command in a guild. Creating a guild command with the same name as an already-existing guild command in the same guild will overwrite the old command. See [Discord Docs/Create Guild Application Command]. # Errors Returns an error of type [`NameLengthInvalid`] if the command name is not between 1 and 32 characters. [`NameLengthInvalid`]: twilight_validate::command::CommandValidationErrorType::NameLengthInvalid [Discord Docs/Create Guild Application Command]: https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command
message
rust
twilight-rs/twilight
twilight-http/src/request/application/command/create_guild_command/mod.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/command/create_guild_command/mod.rs
ISC
pub fn user(self, name: &'a str) -> CreateGuildUserCommand<'a> { CreateGuildUserCommand::new(self.http, self.application_id, self.guild_id, name) }
Create a user command in a guild. Creating a guild command with the same name as an already-existing guild command in the same guild will overwrite the old command. See [Discord Docs/Create Guild Application Command]. # Errors Returns an error of type [`NameLengthInvalid`] if the command name is not between 1 and 32 characters. [`NameLengthInvalid`]: twilight_validate::command::CommandValidationErrorType::NameLengthInvalid [Discord Docs/Create Guild Application Command]: https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command
user
rust
twilight-rs/twilight
twilight-http/src/request/application/command/create_guild_command/mod.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/command/create_guild_command/mod.rs
ISC
pub fn default_member_permissions(mut self, default: Permissions) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.default_member_permissions = Some(default); } self }
Default permissions required for a member to run the command. Defaults to [`None`].
default_member_permissions
rust
twilight-rs/twilight
twilight-http/src/request/application/command/create_guild_command/user.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/command/create_guild_command/user.rs
ISC
pub fn name_localizations(mut self, localizations: &'a HashMap<String, String>) -> Self { self.fields = self.fields.and_then(|mut fields| { for name in localizations.values() { validate_name(name)?; } fields.name_localizations = Some(localizations); Ok(fields) }); self }
Set the localization dictionary for the command name. Defaults to [`None`]. # Errors Returns an error of type [`NameLengthInvalid`] if the name is invalid. [`NameLengthInvalid`]: twilight_validate::command::CommandValidationErrorType::NameLengthInvalid
name_localizations
rust
twilight-rs/twilight
twilight-http/src/request/application/command/create_guild_command/user.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/command/create_guild_command/user.rs
ISC
pub fn nsfw(mut self, nsfw: bool) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.nsfw = Some(nsfw); } self }
Set whether the command is age-restricted. Defaults to not being specified, which uses Discord's default.
nsfw
rust
twilight-rs/twilight
twilight-http/src/request/application/command/create_guild_command/user.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/command/create_guild_command/user.rs
ISC
pub fn allowed_mentions(mut self, allowed_mentions: Option<&'a AllowedMentions>) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.allowed_mentions = Some(Nullable(allowed_mentions)); } self }
Specify the [`AllowedMentions`] for the message. Unless otherwise called, the request will use the client's default allowed mentions. Set to `None` to ignore this default.
allowed_mentions
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/create_followup.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/create_followup.rs
ISC
pub fn attachments(mut self, attachments: &'a [Attachment]) -> Self { if self.fields.is_ok() { if let Err(source) = attachments.iter().try_for_each(validate_attachment) { self.fields = Err(source); } else { self.attachment_manager = self .attachment_manager .set_files(attachments.iter().collect()); } } self }
Attach multiple files to the message. Calling this method will clear any previous calls. # Errors Returns an error of type [`AttachmentDescriptionTooLarge`] if the attachments's description is too large. Returns an error of type [`AttachmentFilename`] if any filename is invalid. [`AttachmentDescriptionTooLarge`]: twilight_validate::message::MessageValidationErrorType::AttachmentDescriptionTooLarge [`AttachmentFilename`]: twilight_validate::message::MessageValidationErrorType::AttachmentFilename
attachments
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/create_followup.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/create_followup.rs
ISC
pub fn components(mut self, components: &'a [Component]) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_components(components)?; fields.components = Some(components); Ok(fields) }); self }
Add multiple [`Component`]s to a message. Calling this method multiple times will clear previous calls. # Errors Refer to the errors section of [`twilight_validate::component::component`] for a list of errors that may be returned as a result of validating each provided component.
components
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/create_followup.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/create_followup.rs
ISC
pub fn content(mut self, content: &'a str) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_content(content)?; fields.content = Some(content); Ok(fields) }); self }
Set the message's content. The maximum length is 2000 UTF-16 characters. # Errors Returns an error of type [`ContentInvalid`] if the content length is too long. [`ContentInvalid`]: twilight_validate::message::MessageValidationErrorType::ContentInvalid
content
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/create_followup.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/create_followup.rs
ISC
pub fn flags(mut self, flags: MessageFlags) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.flags = Some(flags); } self }
Set the message's flags. The only supported flags are [`EPHEMERAL`] and [`SUPPRESS_EMBEDS`]. [`EPHEMERAL`]: MessageFlags::EPHEMERAL [`SUPPRESS_EMBEDS`]: twilight_model::channel::message::MessageFlags::SUPPRESS_EMBEDS
flags
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/create_followup.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/create_followup.rs
ISC
pub fn payload_json(mut self, payload_json: &'a [u8]) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.payload_json = Some(payload_json); } self }
JSON encoded body of any additional request fields. If this method is called, all other fields are ignored, except for [`attachments`]. See [Discord Docs/Uploading Files]. # Examples See [`ExecuteWebhook::payload_json`] for examples. [`attachments`]: Self::attachments [`ExecuteWebhook::payload_json`]: crate::request::channel::webhook::ExecuteWebhook::payload_json [Discord Docs/Uploading Files]: https://discord.com/developers/docs/reference#uploading-files
payload_json
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/create_followup.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/create_followup.rs
ISC
pub fn tts(mut self, tts: bool) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.tts = Some(tts); } self }
Specify true if the message is TTS.
tts
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/create_followup.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/create_followup.rs
ISC
pub fn allowed_mentions(mut self, allowed_mentions: Option<&'a AllowedMentions>) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.allowed_mentions = Some(Nullable(allowed_mentions)); } self }
Specify the [`AllowedMentions`] for the message. Unless otherwise called, the request will use the client's default allowed mentions. Set to `None` to ignore this default.
allowed_mentions
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/update_followup.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/update_followup.rs
ISC
pub fn attachments(mut self, attachments: &'a [Attachment]) -> Self { if self.fields.is_ok() { if let Err(source) = attachments.iter().try_for_each(validate_attachment) { self.fields = Err(source); } else { self.attachment_manager = self .attachment_manager .set_files(attachments.iter().collect()); } } self }
Attach multiple new files to the message. This method clears previous calls. # Errors Returns an error of type [`AttachmentDescriptionTooLarge`] if the attachments' description is too large. Returns an error of type [`AttachmentFilename`] if any filename is invalid. [`AttachmentDescriptionTooLarge`]: twilight_validate::message::MessageValidationErrorType::AttachmentDescriptionTooLarge [`AttachmentFilename`]: twilight_validate::message::MessageValidationErrorType::AttachmentFilename
attachments
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/update_followup.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/update_followup.rs
ISC
pub fn components(mut self, components: Option<&'a [Component]>) -> Self { self.fields = self.fields.and_then(|mut fields| { if let Some(components) = components { validate_components(components)?; } fields.components = Some(Nullable(components)); Ok(fields) }); self }
Set the message's list of [`Component`]s. Calling this method will clear previous calls. # Editing Pass [`None`] to clear existing components. # Errors Refer to the errors section of [`twilight_validate::component::component`] for a list of errors that may be returned as a result of validating each provided component.
components
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/update_followup.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/update_followup.rs
ISC
pub fn content(mut self, content: Option<&'a str>) -> Self { self.fields = self.fields.and_then(|mut fields| { if let Some(content_ref) = content.as_ref() { validate_content(content_ref)?; } fields.content = Some(Nullable(content)); Ok(fields) }); self }
Set the message's content. The maximum length is 2000 UTF-16 characters. # Editing Pass [`None`] to remove the message content. This is impossible if it would leave the message empty of `attachments`, `content`, or `embeds`. # Errors Returns an error of type [`ContentInvalid`] if the content length is too long. [`ContentInvalid`]: twilight_validate::message::MessageValidationErrorType::ContentInvalid
content
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/update_followup.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/update_followup.rs
ISC
pub fn keep_attachment_ids(mut self, attachment_ids: &'a [Id<AttachmentMarker>]) -> Self { if let Ok(fields) = self.fields.as_mut() { self.attachment_manager = self.attachment_manager.set_ids(attachment_ids.to_vec()); // Set an empty list. This will be overwritten in `TryIntoRequest` if // the actual list is not empty. fields.attachments = Some(Nullable(Some(Vec::new()))); } self }
Specify multiple [`Id<AttachmentMarker>`]s already present in the target message to keep. If called, all unspecified attachments (except ones added with [`attachments`]) will be removed from the message. This is impossible if it would leave the message empty of `attachments`, `content`, or `embeds`. If not called, all attachments will be kept. [`attachments`]: Self::attachments
keep_attachment_ids
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/update_followup.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/update_followup.rs
ISC
pub fn payload_json(mut self, payload_json: &'a [u8]) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.payload_json = Some(payload_json); } self }
JSON encoded body of any additional request fields. If this method is called, all other fields are ignored, except for [`attachments`]. See [Discord Docs/Uploading Files]. # Examples See [`ExecuteWebhook::payload_json`] for examples. [`attachments`]: Self::attachments [`ExecuteWebhook::payload_json`]: crate::request::channel::webhook::ExecuteWebhook::payload_json [Discord Docs/Uploading Files]: https://discord.com/developers/docs/reference#uploading-files
payload_json
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/update_followup.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/update_followup.rs
ISC
pub fn allowed_mentions(mut self, allowed_mentions: Option<&'a AllowedMentions>) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.allowed_mentions = Some(Nullable(allowed_mentions)); } self }
Specify the [`AllowedMentions`] for the message. If not called, the request will use the client's default allowed mentions.
allowed_mentions
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/update_response.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/update_response.rs
ISC
pub fn attachments(mut self, attachments: &'a [Attachment]) -> Self { if self.fields.is_ok() { if let Err(source) = attachments.iter().try_for_each(validate_attachment) { self.fields = Err(source); } else { self.attachment_manager = self .attachment_manager .set_files(attachments.iter().collect()); } } self }
Attach multiple new files to the message. This method clears previous calls. # Errors Returns an error of type [`AttachmentDescriptionTooLarge`] if the attachments's description is too large. Returns an error of type [`AttachmentFilename`] if any filename is invalid. [`AttachmentDescriptionTooLarge`]: twilight_validate::message::MessageValidationErrorType::AttachmentDescriptionTooLarge [`AttachmentFilename`]: twilight_validate::message::MessageValidationErrorType::AttachmentFilename
attachments
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/update_response.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/update_response.rs
ISC
pub fn components(mut self, components: Option<&'a [Component]>) -> Self { self.fields = self.fields.and_then(|mut fields| { if let Some(components) = components { validate_components(components)?; } fields.components = Some(Nullable(components)); Ok(fields) }); self }
Set the message's list of [`Component`]s. Calling this method will clear previous calls. # Editing Pass [`None`] to clear existing components. # Errors Refer to the errors section of [`twilight_validate::component::component`] for a list of errors that may be returned as a result of validating each provided component.
components
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/update_response.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/update_response.rs
ISC
pub fn content(mut self, content: Option<&'a str>) -> Self { self.fields = self.fields.and_then(|mut fields| { if let Some(content) = content { validate_content(content)?; } fields.content = Some(Nullable(content)); Ok(fields) }); self }
Set the message's content. The maximum length is 2000 UTF-16 characters. # Editing Pass [`None`] to remove the message content. This is impossible if it would leave the message empty of `attachments`, `content`, or `embeds`. # Errors Returns an error of type [`ContentInvalid`] if the content length is too long. [`ContentInvalid`]: twilight_validate::message::MessageValidationErrorType::ContentInvalid
content
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/update_response.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/update_response.rs
ISC
pub fn keep_attachment_ids(mut self, attachment_ids: &'a [Id<AttachmentMarker>]) -> Self { if let Ok(fields) = self.fields.as_mut() { self.attachment_manager = self.attachment_manager.set_ids(attachment_ids.to_vec()); // Set an empty list. This will be overwritten in `TryIntoRequest` if // the actual list is not empty. fields.attachments = Some(Nullable(Some(Vec::new()))); } self }
Specify multiple [`Id<AttachmentMarker>`]s already present in the target message to keep. If called, all unspecified attachments (except ones added with [`attachments`]) will be removed from the message. This is impossible if it would leave the message empty of `attachments`, `content`, or `embeds`. If not called, all attachments will be kept. [`attachments`]: Self::attachments
keep_attachment_ids
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/update_response.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/update_response.rs
ISC
pub fn payload_json(mut self, payload_json: &'a [u8]) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.payload_json = Some(payload_json); } self }
JSON encoded body of any additional request fields. If this method is called, all other fields are ignored, except for [`attachments`]. See [Discord Docs/Uploading Files]. # Examples See [`ExecuteWebhook::payload_json`] for examples. [Discord Docs/Uploading Files]: https://discord.com/developers/docs/reference#uploading-files [`ExecuteWebhook::payload_json`]: crate::request::channel::webhook::ExecuteWebhook::payload_json [`attachments`]: Self::attachments
payload_json
rust
twilight-rs/twilight
twilight-http/src/request/application/interaction/update_response.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/interaction/update_response.rs
ISC
pub const fn guild_id(mut self, guild_id: Id<GuildMarker>) -> Self { self.fields.guild_id = Some(guild_id); self }
Guild ID to look up entitlements for.
guild_id
rust
twilight-rs/twilight
twilight-http/src/request/application/monetization/get_entitlements.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/monetization/get_entitlements.rs
ISC
pub fn limit(mut self, limit: u8) -> Result<Self, ValidationError> { validate_get_entitlements_limit(limit)?; self.fields.limit = Some(limit); Ok(self) }
Number of entitlements to return. Set to 100 if unspecified. The minimum is 1 and the maximum is 100. # Errors Returns a [`GetEntitlementsError`] error type if the amount is less than 1 or greater than 100. [`GetEntitlementsError`]: twilight_validate::request::ValidationErrorType::GetEntitlements
limit
rust
twilight-rs/twilight
twilight-http/src/request/application/monetization/get_entitlements.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/monetization/get_entitlements.rs
ISC
pub const fn sku_ids(mut self, sku_ids: &'a [Id<SkuMarker>]) -> Self { self.fields.sku_ids = sku_ids; self }
List of SKU IDs to check entitlements for.
sku_ids
rust
twilight-rs/twilight
twilight-http/src/request/application/monetization/get_entitlements.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/monetization/get_entitlements.rs
ISC
pub const fn user_id(mut self, user_id: Id<UserMarker>) -> Self { self.fields.user_id = Some(user_id); self }
User ID to look up entitlements for.
user_id
rust
twilight-rs/twilight
twilight-http/src/request/application/monetization/get_entitlements.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/application/monetization/get_entitlements.rs
ISC
pub fn available_tags(mut self, available_tags: &'a [ForumTag]) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.available_tags = Some(available_tags); } self }
Set the available tags for the forum.
available_tags
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn bitrate(mut self, bitrate: u32) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_bitrate(bitrate)?; fields.bitrate = Some(bitrate); Ok(fields) }); self }
For voice and stage channels, set the bitrate of the channel. Must be at least 8000. # Errors Returns an error of type [`BitrateInvalid`] if the bitrate is invalid. [`BitrateInvalid`]: twilight_validate::channel::ChannelValidationErrorType::BitrateInvalid
bitrate
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn default_forum_layout(mut self, default_forum_layout: ForumLayout) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.default_forum_layout = Some(default_forum_layout); } self }
Set the default layout for forum channels.
default_forum_layout
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn default_reaction_emoji( mut self, default_reaction_emoji: Option<&'a DefaultReaction>, ) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.default_reaction_emoji = Some(Nullable(default_reaction_emoji)); } self }
Set the default reaction emoji for new forum threads.
default_reaction_emoji
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn default_sort_order(mut self, default_sort_order: Option<ForumSortOrder>) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.default_sort_order = Some(Nullable(default_sort_order)); } self }
Set the default sort order for forum channels.
default_sort_order
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn flags(mut self, flags: ChannelFlags) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.flags = Some(flags); } self }
Set the flags of the channel, if supported.
flags
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn forum_topic(mut self, topic: Option<&'a str>) -> Self { self.fields = self.fields.and_then(|mut fields| { if let Some(topic) = topic { validate_forum_topic(topic)?; } fields.topic = topic; Ok(fields) }); self }
Set the forum topic. The maximum length is 4096 UTF-16 characters. See [Discord Docs/Channel Object]. # Errors Returns an error of type [`ForumTopicInvalid`] if the channel type is [`GuildForum`] and the topic is invalid. [Discord Docs/Channel Object]: https://discordapp.com/developers/docs/resources/channel#channel-object-channel-structure [`ForumTopicInvalid`]: twilight_validate::channel::ChannelValidationErrorType::ForumTopicInvalid [`GuildForum`]: twilight_model::channel::ChannelType::GuildForum
forum_topic
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn name(mut self, name: &'a str) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_name(name)?; fields.name = Some(name); Ok(fields) }); self }
Set the name. The minimum length is 1 UTF-16 character and the maximum is 100 UTF-16 characters. # Errors Returns an error of type [`NameInvalid`] if the name is invalid. [`NameInvalid`]: twilight_validate::channel::ChannelValidationErrorType::NameInvalid
name
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn nsfw(mut self, nsfw: bool) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.nsfw = Some(nsfw); } self }
Set whether the channel is marked as NSFW.
nsfw
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn parent_id(mut self, parent_id: Option<Id<ChannelMarker>>) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.parent_id = Some(Nullable(parent_id)); } self }
If this is specified, and the parent ID is a `ChannelType::CategoryChannel`, move this channel to a child of the category channel.
parent_id
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn permission_overwrites( mut self, permission_overwrites: &'a [PermissionOverwrite], ) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.permission_overwrites = Some(permission_overwrites); } self }
Set the permission overwrites of a channel. This will overwrite all permissions that the channel currently has, so use with caution!
permission_overwrites
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn position(mut self, position: u64) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.position = Some(position); } self }
Set the position of the channel. Positions are numerical and zero-indexed. If you place a channel at position 2, channels 2-n will shift down one position and the initial channel will take its place.
position
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn rtc_region(mut self, rtc_region: Option<&'a str>) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.rtc_region = Some(Nullable(rtc_region)); } self }
For voice and stage channels, set the channel's RTC region. Set to `None` to clear.
rtc_region
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn topic(mut self, topic: &'a str) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_topic(topic)?; fields.topic.replace(topic); Ok(fields) }); self }
Set the topic. The maximum length is 1024 UTF-16 characters. See [Discord Docs/Channel Object]. # Errors Returns an error of type [`TopicInvalid`] if the topic is invalid. [Discord Docs/Channel Object]: https://discordapp.com/developers/docs/resources/channel#channel-object-channel-structure [`TopicInvalid`]: twilight_validate::channel::ChannelValidationErrorType::TopicInvalid
topic
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn video_quality_mode(mut self, video_quality_mode: VideoQualityMode) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.video_quality_mode = Some(video_quality_mode); } self }
Set the [`VideoQualityMode`] for the voice channel.
video_quality_mode
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn kind(mut self, kind: ChannelType) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.kind = Some(kind); } self }
Set the kind of channel. Only conversion between `ChannelType::GuildText` and `ChannelType::GuildAnnouncement` is possible, and only if the guild has the `NEWS` feature enabled. See [Discord Docs/Modify Channel]. [Discord Docs/Modify Channel]: https://discord.com/developers/docs/resources/channel#modify-channel-json-params-guild-channel
kind
rust
twilight-rs/twilight
twilight-http/src/request/channel/update_channel.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/update_channel.rs
ISC
pub fn max_age(mut self, max_age: u32) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_invite_max_age(max_age)?; fields.max_age = Some(max_age); Ok(fields) }); self }
Set the maximum age for an invite. If no age is specified, Discord sets the age to 86400 seconds, or 24 hours. Set to 0 to never expire. # Examples Create an invite for a channel with a maximum of 1 use and an age of 1 hour: ```no_run use std::env; use twilight_http::Client; use twilight_model::id::Id; # #[tokio::main] # async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = Client::new(env::var("DISCORD_TOKEN")?); let invite = client .create_invite(Id::new(1)) .max_age(60 * 60) .await? .model() .await?; println!("invite code: {}", invite.code); # Ok(()) } ``` # Errors Returns an error of type [`InviteMaxAge`] if the age is invalid. [`InviteMaxAge`]: twilight_validate::request::ValidationErrorType::InviteMaxAge
max_age
rust
twilight-rs/twilight
twilight-http/src/request/channel/invite/create_invite.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/invite/create_invite.rs
ISC
pub fn max_uses(mut self, max_uses: u16) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_invite_max_uses(max_uses)?; fields.max_uses = Some(max_uses); Ok(fields) }); self }
Set the maximum uses for an invite, or 0 for infinite. Discord defaults this to 0, or infinite. # Examples Create an invite for a channel with a maximum of 5 uses: ```no_run use std::env; use twilight_http::Client; use twilight_model::id::Id; # #[tokio::main] # async fn main() -> Result<(), Box<dyn std::error::Error>> { let client = Client::new(env::var("DISCORD_TOKEN")?); let invite = client .create_invite(Id::new(1)) .max_uses(5) .await? .model() .await?; println!("invite code: {}", invite.code); # Ok(()) } ``` # Errors Returns an error of type [`InviteMaxUses`] if the uses is invalid. [`InviteMaxUses`]: twilight_validate::request::ValidationErrorType::InviteMaxUses
max_uses
rust
twilight-rs/twilight
twilight-http/src/request/channel/invite/create_invite.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/invite/create_invite.rs
ISC
pub fn target_application_id(mut self, target_application_id: Id<ApplicationMarker>) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.target_application_id = Some(target_application_id); } self }
Set the target application ID for this invite. This only works if [`target_type`] is set to [`TargetType::EmbeddedApplication`]. [`target_type`]: Self::target_type
target_application_id
rust
twilight-rs/twilight
twilight-http/src/request/channel/invite/create_invite.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/invite/create_invite.rs
ISC
pub fn target_user_id(mut self, target_user_id: Id<UserMarker>) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.target_user_id = Some(target_user_id); } self }
Set the target user id for this invite.
target_user_id
rust
twilight-rs/twilight
twilight-http/src/request/channel/invite/create_invite.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/invite/create_invite.rs
ISC
pub fn target_type(mut self, target_type: TargetType) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.target_type = Some(target_type); } self }
Set the target type for this invite.
target_type
rust
twilight-rs/twilight
twilight-http/src/request/channel/invite/create_invite.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/invite/create_invite.rs
ISC
pub fn temporary(mut self, temporary: bool) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.temporary = Some(temporary); } self }
Specify true if the invite should grant temporary membership. Defaults to false.
temporary
rust
twilight-rs/twilight
twilight-http/src/request/channel/invite/create_invite.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/invite/create_invite.rs
ISC
pub fn unique(mut self, unique: bool) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.unique = Some(unique); } self }
Specify true if the invite should be unique. Defaults to false. If true, don't try to reuse a similar invite (useful for creating many unique one time use invites). See [Discord Docs/Create Channel Invite]. [Discord Docs/Create Channel Invite]: https://discord.com/developers/docs/resources/channel#create-channel-invite
unique
rust
twilight-rs/twilight
twilight-http/src/request/channel/invite/create_invite.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/invite/create_invite.rs
ISC
pub const fn with_counts(mut self) -> Self { self.fields.with_counts = true; self }
Whether the invite returned should contain approximate member counts.
with_counts
rust
twilight-rs/twilight
twilight-http/src/request/channel/invite/get_invite.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/invite/get_invite.rs
ISC
pub const fn with_expiration(mut self) -> Self { self.fields.with_expiration = true; self }
Whether the invite returned should contain its expiration date.
with_expiration
rust
twilight-rs/twilight
twilight-http/src/request/channel/invite/get_invite.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/invite/get_invite.rs
ISC
pub fn allowed_mentions(mut self, allowed_mentions: Option<&'a AllowedMentions>) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.allowed_mentions = Some(Nullable(allowed_mentions)); } self }
Specify the [`AllowedMentions`] for the message. Unless otherwise called, the request will use the client's default allowed mentions. Set to `None` to ignore this default.
allowed_mentions
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/create_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/create_message.rs
ISC
pub fn attachments(mut self, attachments: &'a [Attachment]) -> Self { if self.fields.is_ok() { if let Err(source) = attachments.iter().try_for_each(validate_attachment) { self.fields = Err(source); } else { self.attachment_manager = self .attachment_manager .set_files(attachments.iter().collect()); } } self }
Attach multiple files to the message. Calling this method will clear previous calls. # Errors Returns an error of type [`AttachmentDescriptionTooLarge`] if the attachments's description is too large. Returns an error of type [`AttachmentFilename`] if any filename is invalid. [`AttachmentDescriptionTooLarge`]: twilight_validate::message::MessageValidationErrorType::AttachmentDescriptionTooLarge [`AttachmentFilename`]: twilight_validate::message::MessageValidationErrorType::AttachmentFilename
attachments
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/create_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/create_message.rs
ISC
pub fn components(mut self, components: &'a [Component]) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_components(components)?; fields.components = Some(components); Ok(fields) }); self }
Set the message's list of [`Component`]s. Calling this method will clear previous calls. # Errors Refer to the errors section of [`twilight_validate::component::component`] for a list of errors that may be returned as a result of validating each provided component.
components
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/create_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/create_message.rs
ISC
pub fn content(mut self, content: &'a str) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_content(content)?; fields.content.replace(content); Ok(fields) }); self }
Set the message's content. The maximum length is 2000 UTF-16 characters. # Errors Returns an error of type [`ContentInvalid`] if the content length is too long. [`ContentInvalid`]: twilight_validate::message::MessageValidationErrorType::ContentInvalid
content
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/create_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/create_message.rs
ISC
pub fn poll(mut self, poll: &'a Poll) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.poll = Some(poll); } self }
Specify if this message is a poll.
poll
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/create_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/create_message.rs
ISC
pub fn fail_if_not_exists(mut self, fail_if_not_exists: bool) -> Self { if let Ok(fields) = self.fields.as_mut() { if let Some(reference) = fields.message_reference.as_mut() { reference.fail_if_not_exists = Some(fail_if_not_exists); } else { fields.message_reference = Some(MessageReference { kind: MessageReferenceType::default(), channel_id: None, guild_id: None, message_id: None, fail_if_not_exists: Some(fail_if_not_exists), }); } } self }
Whether to fail sending if the reply no longer exists. Defaults to [`true`].
fail_if_not_exists
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/create_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/create_message.rs
ISC
pub fn flags(mut self, flags: MessageFlags) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.flags = Some(flags); } self }
Set the message's flags. The only supported flags are [`SUPPRESS_EMBEDS`] and [`SUPPRESS_NOTIFICATIONS`]. [`SUPPRESS_EMBEDS`]: MessageFlags::SUPPRESS_EMBEDS [`SUPPRESS_NOTIFICATIONS`]: MessageFlags::SUPPRESS_NOTIFICATIONS
flags
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/create_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/create_message.rs
ISC
pub fn nonce(mut self, nonce: u64) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.nonce = Some(nonce); } self }
Attach a nonce to the message, for optimistic message sending.
nonce
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/create_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/create_message.rs
ISC
pub fn payload_json(mut self, payload_json: &'a [u8]) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.payload_json = Some(payload_json); } self }
JSON encoded body of any additional request fields. If this method is called, all other fields are ignored, except for [`attachments`]. See [Discord Docs/Uploading Files]. # Examples See [`ExecuteWebhook::payload_json`] for examples. [Discord Docs/Uploading Files]: https://discord.com/developers/docs/reference#uploading-files [`ExecuteWebhook::payload_json`]: crate::request::channel::webhook::ExecuteWebhook::payload_json [`attachments`]: Self::attachments
payload_json
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/create_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/create_message.rs
ISC
pub fn reply(mut self, other: Id<MessageMarker>) -> Self { self.fields = self.fields.map(|mut fields| { let channel_id = self.channel_id; let reference = if let Some(reference) = fields.message_reference { MessageReference { channel_id: Some(channel_id), message_id: Some(other), ..reference } } else { MessageReference { kind: MessageReferenceType::Default, channel_id: Some(channel_id), guild_id: None, message_id: Some(other), fail_if_not_exists: None, } }; fields.message_reference = Some(reference); fields }); self }
Specify the ID of another message to create a reply to.
reply
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/create_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/create_message.rs
ISC
pub fn forward(mut self, other: Id<MessageMarker>) -> Self { self.fields = self.fields.map(|mut fields| { let channel_id = self.channel_id; let reference = if let Some(reference) = fields.message_reference { MessageReference { channel_id: Some(channel_id), message_id: Some(other), ..reference } } else { MessageReference { kind: MessageReferenceType::Forward, channel_id: Some(channel_id), guild_id: None, message_id: Some(other), fail_if_not_exists: None, } }; fields.message_reference = Some(reference); fields }); self }
Specify the ID of another message to forward.
forward
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/create_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/create_message.rs
ISC
pub fn sticker_ids(mut self, sticker_ids: &'a [Id<StickerMarker>]) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_sticker_ids(sticker_ids)?; fields.sticker_ids = Some(sticker_ids); Ok(fields) }); self }
Set the IDs of up to 3 guild stickers. # Errors Returns an error of type [`StickersInvalid`] if the length is invalid. [`StickersInvalid`]: twilight_validate::message::MessageValidationErrorType::StickersInvalid
sticker_ids
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/create_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/create_message.rs
ISC
pub fn tts(mut self, tts: bool) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.tts = Some(tts); } self }
Specify true if the message is TTS.
tts
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/create_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/create_message.rs
ISC
pub fn limit(mut self, limit: u16) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_get_channel_messages_limit(limit)?; fields.limit = Some(limit); Ok(fields) }); self }
Set the maximum number of messages to retrieve. The minimum is 1 and the maximum is 100. # Errors Returns an error of type [`GetChannelMessages`] error type if the amount is less than 1 or greater than 100. [`GetChannelMessages`]: twilight_validate::request::ValidationErrorType::GetChannelMessages
limit
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/get_channel_messages.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/get_channel_messages.rs
ISC
pub fn limit(mut self, limit: u16) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_get_channel_messages_limit(limit)?; fields.limit = Some(limit); Ok(fields) }); self }
Set the maximum number of messages to retrieve. The minimum is 1 and the maximum is 100. # Errors Returns an error of type [`GetChannelMessages`] error type if the amount is less than 1 or greater than 100. [`GetChannelMessages`]: twilight_validate::request::ValidationErrorType::GetChannelMessages
limit
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/get_channel_messages_configured.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/get_channel_messages_configured.rs
ISC
pub fn allowed_mentions(mut self, allowed_mentions: Option<&'a AllowedMentions>) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.allowed_mentions = Some(Nullable(allowed_mentions)); } self }
Specify the [`AllowedMentions`] for the message. If not called, the request will use the client's default allowed mentions.
allowed_mentions
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/update_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/update_message.rs
ISC
pub fn attachments(mut self, attachments: &'a [Attachment]) -> Self { if self.fields.is_ok() { if let Err(source) = attachments.iter().try_for_each(validate_attachment) { self.fields = Err(source); } else { self.attachment_manager = self .attachment_manager .set_files(attachments.iter().collect()); } } self }
Attach multiple new files to the message. This method clears previous calls. # Errors Returns an error of type [`AttachmentDescriptionTooLarge`] if the attachments's description is too large. Returns an error of type [`AttachmentFilename`] if any filename is invalid. [`AttachmentDescriptionTooLarge`]: twilight_validate::message::MessageValidationErrorType::AttachmentDescriptionTooLarge [`AttachmentFilename`]: twilight_validate::message::MessageValidationErrorType::AttachmentFilename
attachments
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/update_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/update_message.rs
ISC
pub fn components(mut self, components: Option<&'a [Component]>) -> Self { self.fields = self.fields.and_then(|mut fields| { if let Some(components) = components { validate_components(components)?; } fields.components = Some(Nullable(components)); Ok(fields) }); self }
Set the message's list of [`Component`]s. Calling this method will clear previous calls. # Editing Pass [`None`] to clear existing components. # Errors Refer to the errors section of [`twilight_validate::component::component`] for a list of errors that may be returned as a result of validating each provided component.
components
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/update_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/update_message.rs
ISC
pub fn content(mut self, content: Option<&'a str>) -> Self { self.fields = self.fields.and_then(|mut fields| { if let Some(content) = content { validate_content(content)?; } fields.content = Some(Nullable(content)); Ok(fields) }); self }
Set the message's content. The maximum length is 2000 UTF-16 characters. # Editing Pass [`None`] to remove the message content. This is impossible if it would leave the message empty of `attachments`, `content`, `embeds`, or `sticker_ids`. # Errors Returns an error of type [`ContentInvalid`] if the content length is too long. [`ContentInvalid`]: twilight_validate::message::MessageValidationErrorType::ContentInvalid
content
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/update_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/update_message.rs
ISC
pub fn flags(mut self, flags: MessageFlags) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.flags = Some(flags); } self }
Set the message's flags. The only supported flag is [`SUPPRESS_EMBEDS`]. [`SUPPRESS_EMBEDS`]: MessageFlags::SUPPRESS_EMBEDS
flags
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/update_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/update_message.rs
ISC
pub fn keep_attachment_ids(mut self, attachment_ids: &'a [Id<AttachmentMarker>]) -> Self { if let Ok(fields) = self.fields.as_mut() { self.attachment_manager = self.attachment_manager.set_ids(attachment_ids.to_vec()); // Set an empty list. This will be overwritten in `TryIntoRequest` if // the actual list is not empty. fields.attachments = Some(Nullable(Some(Vec::new()))); } self }
Specify multiple [`Id<AttachmentMarker>`]s already present in the target message to keep. If called, all unspecified attachments (except ones added with [`attachments`]) will be removed from the message. This is impossible if it would leave the message empty of `attachments`, `content`, `embeds`, or `sticker_ids`. If not called, all attachments will be kept. [`attachments`]: Self::attachments
keep_attachment_ids
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/update_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/update_message.rs
ISC
pub fn payload_json(mut self, payload_json: &'a [u8]) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.payload_json = Some(payload_json); } self }
JSON encoded body of any additional request fields. If this method is called, all other fields are ignored, except for [`attachments`]. See [Discord Docs/Uploading Files]. # Examples See [`ExecuteWebhook::payload_json`] for examples. [Discord Docs/Uploading Files]: https://discord.com/developers/docs/reference#uploading-files [`ExecuteWebhook::payload_json`]: crate::request::channel::webhook::ExecuteWebhook::payload_json [`attachments`]: Self::attachments
payload_json
rust
twilight-rs/twilight
twilight-http/src/request/channel/message/update_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/message/update_message.rs
ISC
pub fn kind(mut self, kind: ReactionType) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.kind = Some(kind); } self }
Set the kind of reaction to retrieve. This can be either a super reaction or a normal reaction.
kind
rust
twilight-rs/twilight
twilight-http/src/request/channel/reaction/get_reactions.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/reaction/get_reactions.rs
ISC
pub fn guild_scheduled_event_id( mut self, guild_scheduled_event_id: Id<ScheduledEventMarker>, ) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.guild_scheduled_event_id = Some(guild_scheduled_event_id); } self }
Set the guild scheduled event associated with this stage instance.
guild_scheduled_event_id
rust
twilight-rs/twilight
twilight-http/src/request/channel/stage/create_stage_instance.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/stage/create_stage_instance.rs
ISC
pub fn privacy_level(mut self, privacy_level: PrivacyLevel) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.privacy_level = Some(privacy_level); } self }
Set the [`PrivacyLevel`] of the instance.
privacy_level
rust
twilight-rs/twilight
twilight-http/src/request/channel/stage/create_stage_instance.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/stage/create_stage_instance.rs
ISC
pub fn send_start_notification(mut self, send_start_notification: bool) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.send_start_notification = Some(send_start_notification); } self }
Set whether to notify everyone when a stage starts. The stage moderator must have [`Permissions::MENTION_EVERYONE`] for this notification to be sent. [`Permissions::MENTION_EVERYONE`]: twilight_model::guild::Permissions::MENTION_EVERYONE
send_start_notification
rust
twilight-rs/twilight
twilight-http/src/request/channel/stage/create_stage_instance.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/stage/create_stage_instance.rs
ISC
pub fn privacy_level(mut self, privacy_level: PrivacyLevel) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.privacy_level = Some(privacy_level); } self }
Set the [`PrivacyLevel`] of the instance.
privacy_level
rust
twilight-rs/twilight
twilight-http/src/request/channel/stage/update_stage_instance.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/stage/update_stage_instance.rs
ISC
pub fn topic(mut self, topic: &'a str) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_stage_topic(topic)?; fields.topic.replace(topic); Ok(fields) }); self }
Set the new topic of the instance. # Errors Returns an error of type [`StageTopic`] if the length is invalid. [`StageTopic`]: twilight_validate::request::ValidationErrorType::StageTopic
topic
rust
twilight-rs/twilight
twilight-http/src/request/channel/stage/update_stage_instance.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/stage/update_stage_instance.rs
ISC
pub fn auto_archive_duration(mut self, auto_archive_duration: AutoArchiveDuration) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.auto_archive_duration = Some(auto_archive_duration); } self }
Set the thread's auto archive duration. Automatic archive durations are not locked behind the guild's boost level.
auto_archive_duration
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/create_thread.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/create_thread.rs
ISC
pub fn invitable(mut self, invitable: bool) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.invitable = Some(invitable); } self }
Whether non-moderators can add other non-moderators to a thread.
invitable
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/create_thread.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/create_thread.rs
ISC
pub fn auto_archive_duration(mut self, auto_archive_duration: AutoArchiveDuration) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.auto_archive_duration = Some(auto_archive_duration); } self }
Set the thread's auto archive duration. Automatic archive durations are not locked behind the guild's boost level.
auto_archive_duration
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/create_thread_from_message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/create_thread_from_message.rs
ISC
pub const fn limit(mut self, limit: u64) -> Self { self.limit = Some(limit); self }
Maximum number of threads to return.
limit
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/get_joined_private_archived_threads.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/get_joined_private_archived_threads.rs
ISC
pub const fn before(mut self, before: &'a str) -> Self { self.before = Some(before); self }
Return threads before this ISO 8601 timestamp.
before
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/get_private_archived_threads.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/get_private_archived_threads.rs
ISC
pub const fn limit(mut self, limit: u64) -> Self { self.limit = Some(limit); self }
Maximum number of threads to return.
limit
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/get_private_archived_threads.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/get_private_archived_threads.rs
ISC
pub const fn before(mut self, before: &'a str) -> Self { self.before = Some(before); self }
Return threads before this ISO 8601 timestamp.
before
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/get_public_archived_threads.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/get_public_archived_threads.rs
ISC
pub const fn limit(mut self, limit: u64) -> Self { self.limit = Some(limit); self }
Maximum number of threads to return.
limit
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/get_public_archived_threads.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/get_public_archived_threads.rs
ISC
pub fn after(mut self, after: Id<UserMarker>) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.after = Some(after); } self }
Fetch the thread members after the user ID.
after
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/get_thread_members.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/get_thread_members.rs
ISC
pub fn with_member(mut self, with_member: bool) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.with_member = Some(with_member); } self }
Include the associated guild members for each thread member.
with_member
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/get_thread_members.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/get_thread_members.rs
ISC
pub fn applied_tags(mut self, applied_tags: Option<&'a [Id<TagMarker>]>) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.applied_tags = Some(Nullable(applied_tags)); } self }
Set the forum thread's applied tags.
applied_tags
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/update_thread.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/update_thread.rs
ISC
pub fn archived(mut self, archived: bool) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.archived = Some(archived); } self }
Set whether the thread is archived. Requires that the user have [`SEND_MESSAGES`] in the thread. However, if the thread is locked, the user must have [`MANAGE_THREADS`]. [`SEND_MESSAGES`]: twilight_model::guild::Permissions::SEND_MESSAGES [`MANAGE_THREADS`]: twilight_model::guild::Permissions::MANAGE_THREADS
archived
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/update_thread.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/update_thread.rs
ISC
pub fn auto_archive_duration(mut self, auto_archive_duration: AutoArchiveDuration) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.auto_archive_duration = Some(auto_archive_duration); } self }
Set the thread's auto archive duration. Automatic archive durations are not locked behind the guild's boost level.
auto_archive_duration
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/update_thread.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/update_thread.rs
ISC
pub fn invitable(mut self, invitable: bool) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.invitable = Some(invitable); } self }
Whether non-moderators can add other non-moderators to a thread.
invitable
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/update_thread.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/update_thread.rs
ISC
pub fn locked(mut self, locked: bool) -> Self { if let Ok(fields) = self.fields.as_mut() { fields.locked = Some(locked); } self }
Set whether the thread is locked. If the thread is already locked, only users with [`MANAGE_THREADS`] can unlock it. [`MANAGE_THREADS`]: twilight_model::guild::Permissions::MANAGE_THREADS
locked
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/update_thread.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/update_thread.rs
ISC
pub fn name(mut self, name: &'a str) -> Self { self.fields = self.fields.and_then(|mut fields| { validate_name(name)?; fields.name = Some(name); Ok(fields) }); self }
Set the name of the thread. Must be between 1 and 100 characters in length. # Errors Returns an error of type [`NameInvalid`] if the name is invalid. [`NameInvalid`]: twilight_validate::channel::ChannelValidationErrorType::NameInvalid
name
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/update_thread.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/update_thread.rs
ISC
pub fn allowed_mentions(mut self, allowed_mentions: Option<&'a AllowedMentions>) -> Self { if let Ok(inner) = self.0.as_mut() { inner.fields.message.allowed_mentions = Some(Nullable(allowed_mentions)); } self }
Specify the [`AllowedMentions`] for the message. Unless otherwise called, the request will use the client's default allowed mentions. Set to `None` to ignore this default.
allowed_mentions
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/create_forum_thread/message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/create_forum_thread/message.rs
ISC
pub fn attachments(mut self, attachments: &'a [Attachment]) -> Self { if self.0.is_ok() { let validation = attachments .iter() .try_for_each(|attachment| validate_attachment_filename(&attachment.filename)); if let Err(source) = validation { self.0 = Err(source); } else if let Ok(inner) = self.0.as_mut() { let mut manager = mem::take(&mut inner.attachment_manager); manager = manager.set_files(attachments.iter().collect()); inner.attachment_manager = manager; } } self }
Attach multiple files to the message. Calling this method will clear any previous calls. # Errors Returns an error of type [`AttachmentFilename`] if any filename is invalid. [`AttachmentFilename`]: twilight_validate::message::MessageValidationErrorType::AttachmentFilename
attachments
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/create_forum_thread/message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/create_forum_thread/message.rs
ISC
pub fn components(mut self, components: &'a [Component]) -> Self { self.0 = self.0.and_then(|mut inner| { validate_components(components)?; inner.fields.message.components = Some(components); Ok(inner) }); self }
Set the message's list of [`Component`]s. Calling this method will clear previous calls. Requires a webhook owned by the application. # Errors Refer to the errors section of [`twilight_validate::component::component`] for a list of errors that may be returned as a result of validating each provided component.
components
rust
twilight-rs/twilight
twilight-http/src/request/channel/thread/create_forum_thread/message.rs
https://github.com/twilight-rs/twilight/blob/master/twilight-http/src/request/channel/thread/create_forum_thread/message.rs
ISC