1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
mod data;
pub use self::data::{
CommandData, CommandDataOption, CommandInteractionDataResolved, CommandOptionValue,
InteractionChannel, InteractionMember,
};
use super::InteractionType;
use crate::{
guild::PartialMember,
id::{
marker::{ApplicationMarker, ChannelMarker, GuildMarker, InteractionMarker},
Id,
},
user::User,
};
use serde::Serialize;
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
#[serde(rename(serialize = "Interaction"))]
pub struct ApplicationCommand {
pub application_id: Id<ApplicationMarker>,
pub channel_id: Id<ChannelMarker>,
pub data: CommandData,
#[serde(skip_serializing_if = "Option::is_none")]
pub guild_id: Option<Id<GuildMarker>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub guild_locale: Option<String>,
pub id: Id<InteractionMarker>,
#[serde(rename = "type")]
pub kind: InteractionType,
pub locale: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub member: Option<PartialMember>,
pub token: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<User>,
}