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
use serde::{Deserialize, Serialize};
use serde_json::Value;
use crate::entities::{AllowedMention, Embed};
use crate::utils::Snowflake;

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Interaction {
    pub id: Snowflake,
    pub r#type: InteractionType,
    pub data: Value,
    pub guild_id: Snowflake,
    pub channel_id: Snowflake,
    pub member_id: Snowflake,
    pub token: String,
    pub version: i32,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum InteractionType {
    SelfCommand = 0,
    Ping = 1,
    ApplicationCommand = 2
}

pub enum InteractionResponseType {
    SelfCommandResponse = 0,
    Pong = 1,
    Acknowledge = 2,
    ChannelMessage = 3,
    ChannelMessageWithSource = 4,
    AcknowledgeWithSource = 5,
}

pub struct InteractionApplicationCommandCallbackData {
    pub tts: bool,
    pub content: String,
    pub embeds: Vec<Embed>,
    pub allowed_mentions: AllowedMention
}