diff --git a/src/api/schemas.rs b/src/api/schemas.rs index 08425a3..7672e55 100644 --- a/src/api/schemas.rs +++ b/src/api/schemas.rs @@ -1,8 +1,12 @@ +use std::{collections::HashMap, io::Bytes}; + use regex::Regex; -use serde::{Deserialize, Serialize}; +use serde::{ser::SerializeMap, Deserialize, Serialize, Serializer}; use crate::errors::FieldFormatError; +use super::{DiscordFileAttachment, Embed}; + /** A struct that represents a well-formed email address. */ @@ -240,6 +244,24 @@ pub struct TotpSchema { login_source: Option, } +#[derive(Debug, Deserialize)] +#[serde(rename_all = "snake_case")] +pub struct MessageSendSchema { + #[serde(rename = "type")] + message_type: i32, + content: Option, + nonce: Option, + tts: Option, + embeds: Option>, + allowed_mentions: Option, + message_reference: Option, + components: Option>, + sticker_ids: Option>, + #[serde(flatten)] + files: Option>>, + attachments: Option>, +} + // I know that some of these tests are... really really basic and unneccessary, but sometimes, I // just feel like writing tests, so there you go :) -@bitfl0wer #[cfg(test)]