From 125554839f4222465103d1b2c7ab58e5c30a86a6 Mon Sep 17 00:00:00 2001 From: n1c00o Date: Sat, 16 Oct 2021 22:09:32 +0200 Subject: [PATCH] Fix types --- .../rust/src/discord_models/slash_commands.rs | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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, +} -- 2.39.5