From: n1c00o Date: Sat, 16 Oct 2021 20:09:32 +0000 (+0200) Subject: Fix types X-Git-Tag: v0.1~55^2~6 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=125554839f4222465103d1b2c7ab58e5c30a86a6;p=matthieu%2Fnova.git Fix types --- diff --git a/common/rust/src/discord_models/slash_commands.rs b/common/rust/src/discord_models/slash_commands.rs index 919fb60..ae0f190 100644 --- a/common/rust/src/discord_models/slash_commands.rs +++ b/common/rust/src/discord_models/slash_commands.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; use serde_repr::{Deserialize_repr, Serialize_repr}; -use super::user::User; +use super::{channel::Message, guild::GuildMember, user::User}; #[derive(Debug, Clone, Deserialize_repr, Serialize_repr)] #[repr(u8)] @@ -14,7 +14,7 @@ pub enum ApplicationCommandOptionType { User = 6, Channel = 7, Role = 8, - Mentionable = 8, + Mentionable = 9, } #[derive(Debug, Clone, Deserialize, Serialize)] @@ -85,3 +85,20 @@ pub struct MessageInteraction { pub name: String, pub user: User, } + +#[derive(Debug, Clone, Deserialize, Serialize)] +pub struct Interaction { + pub id: String, + pub application_id: String, + #[serde(rename = "type")] + pub type_: InteractionRequestType, + /// i am not sure about this one https://canary.discord.com/developers/docs/interactions/slash-commands#interaction-object-application-command-interaction-data + pub data: ApplicationCommand, + pub guild_id: Option, + pub channel_id: Option, + pub member: Option, + pub user: Option, + pub token: String, + pub version: i64, + pub message: Option, +}