pub struct CommandData {
pub guild_id: Option<Id<GuildMarker>>,
pub id: Id<CommandMarker>,
pub kind: CommandType,
pub name: String,
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.
kind: CommandTypeType of the command.
name: StringName 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§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 From<Box<CommandData>> for InteractionData
impl From<Box<CommandData>> for InteractionData
Source§fn from(value: Box<CommandData>) -> Self
fn from(value: Box<CommandData>) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CommandData
impl PartialEq for CommandData
Source§impl Serialize for CommandData
impl Serialize for CommandData
impl StructuralPartialEq for CommandData
Source§impl TryFrom<InteractionData> for Box<CommandData>
impl TryFrom<InteractionData> for Box<CommandData>
Source§type Error = InteractionData
type Error = InteractionData
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Forget for CommandData
impl Freeze for CommandDatawhere
PhantomData<fn(GuildMarker) -> GuildMarker>: Freeze,
NonZero<u64>: Freeze,
PhantomData<fn(CommandMarker) -> CommandMarker>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<CommandDataOption>: Freeze,
PhantomData<(Id<AttachmentMarker>, Attachment)>: Freeze,
PhantomData<(Id<ChannelMarker>, InteractionChannel)>: Freeze,
PhantomData<(Id<UserMarker>, InteractionMember)>: Freeze,
PhantomData<(Id<MessageMarker>, Message)>: Freeze,
PhantomData<(Id<RoleMarker>, Role)>: Freeze,
PhantomData<(Id<UserMarker>, User)>: Freeze,
PhantomData<fn(GenericMarker) -> GenericMarker>: Freeze,
impl Move for CommandData
impl RefUnwindSafe for CommandDatawhere
NonZero<u64>: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
NonZero<i32>: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
InternalBitFlags: RefUnwindSafe,
impl Send for CommandDatawhere
NonZero<u64>: Send,
RawVecInner: Send,
RawTable<(Id<AttachmentMarker>, Attachment)>: Send,
RawTable<(Id<ChannelMarker>, InteractionChannel)>: Send,
RawTable<(Id<UserMarker>, InteractionMember)>: Send,
RawTable<(Id<MessageMarker>, Message)>: Send,
RawTable<(Id<RoleMarker>, Role)>: Send,
RawTable<(Id<UserMarker>, User)>: Send,
impl Sync for CommandDatawhere
NonZero<u64>: Sync,
RawVecInner: Sync,
RawTable<(Id<AttachmentMarker>, Attachment)>: Sync,
RawTable<(Id<ChannelMarker>, InteractionChannel)>: Sync,
RawTable<(Id<UserMarker>, InteractionMember)>: Sync,
RawTable<(Id<MessageMarker>, Message)>: Sync,
RawTable<(Id<RoleMarker>, Role)>: Sync,
RawTable<(Id<UserMarker>, User)>: Sync,
impl Unpin for CommandDatawhere
NonZero<u64>: Unpin,
*const u8 is !null: Unpin,
InternalBitFlags: Unpin,
InternalBitFlags: Unpin,
NonZero<i32>: Unpin,
InternalBitFlags: Unpin,
InternalBitFlags: Unpin,
InternalBitFlags: Unpin,
Box<Component>: Unpin,
InternalBitFlags: Unpin,
InternalBitFlags: Unpin,
InternalBitFlags: Unpin,
Box<InteractionMetadata>: Unpin,
Box<Message>: Unpin,
InternalBitFlags: Unpin,
InternalBitFlags: Unpin,
InternalBitFlags: Unpin,
impl UnsafeUnpin for CommandDatawhere
PhantomData<fn(GuildMarker) -> GuildMarker>: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
PhantomData<fn(CommandMarker) -> CommandMarker>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<CommandDataOption>: UnsafeUnpin,
PhantomData<(Id<AttachmentMarker>, Attachment)>: UnsafeUnpin,
PhantomData<(Id<ChannelMarker>, InteractionChannel)>: UnsafeUnpin,
PhantomData<(Id<UserMarker>, InteractionMember)>: UnsafeUnpin,
PhantomData<(Id<MessageMarker>, Message)>: UnsafeUnpin,
PhantomData<(Id<RoleMarker>, Role)>: UnsafeUnpin,
PhantomData<(Id<UserMarker>, User)>: UnsafeUnpin,
PhantomData<fn(GenericMarker) -> GenericMarker>: UnsafeUnpin,
impl UnwindSafe for CommandDatawhere
NonZero<u64>: UnwindSafe,
RawVecInner: UnwindSafe,
HashMap<Id<AttachmentMarker>, Attachment>: UnwindSafe,
HashMap<Id<ChannelMarker>, InteractionChannel>: UnwindSafe,
HashMap<Id<UserMarker>, InteractionMember>: UnwindSafe,
HashMap<Id<MessageMarker>, Message>: UnwindSafe,
HashMap<Id<RoleMarker>, Role>: UnwindSafe,
HashMap<Id<UserMarker>, User>: UnwindSafe,
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