pub struct CommandData {
pub guild_id: Option<Id<GuildMarker>>,
pub id: Id<CommandMarker>,
pub name: String,
pub kind: CommandType,
pub options: Vec<CommandDataOption>,
pub resolved: Option<InteractionDataResolved>,
pub target_id: Option<Id<GenericMarker>>,
}
Expand description
Data received when an ApplicationCommand
or ApplicationCommandAutocomplete
interaction is executed.
Fields§
§guild_id: Option<Id<GuildMarker>>
ID of the guild the command is registered to.
id: Id<CommandMarker>
ID of the command.
name: String
Name of the command.
kind: CommandType
Type of the command.
options: Vec<CommandDataOption>
List of options specified by the user.
resolved: Option<InteractionDataResolved>
Resolved data from the interaction’s options.
target_id: Option<Id<GenericMarker>>
If this is a user or message command, the ID of the targeted user/message.
Trait Implementations§
source§impl Clone for CommandData
impl Clone for CommandData
source§fn clone(&self) -> CommandData
fn clone(&self) -> CommandData
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CommandData
impl Debug for CommandData
source§impl<'de> Deserialize<'de> for CommandData
impl<'de> Deserialize<'de> for CommandData
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for CommandData
impl PartialEq for CommandData
source§impl Serialize for CommandData
impl Serialize for CommandData
impl StructuralPartialEq for CommandData
Auto Trait Implementations§
impl Freeze for CommandData
impl RefUnwindSafe for CommandData
impl Send for CommandData
impl Sync for CommandData
impl Unpin for CommandData
impl UnwindSafe for CommandData
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)