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
use serde::{Deserialize, Serialize};
use crate::entities::{AllowedMention, Component, Embed, MessageReference, PartialDiscordFileAttachment};

#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]
pub struct MessageSendSchema {
    #[serde(rename = "type")]
    message_type: Option<i32>,
    content: Option<String>,
    nonce: Option<String>,
    tts: Option<bool>,
    embeds: Option<Vec<Embed>>,
    allowed_mentions: Option<AllowedMention>,
    message_reference: Option<MessageReference>,
    components: Option<Vec<Component>>,
    sticker_ids: Option<Vec<String>>,
    pub attachments: Option<Vec<PartialDiscordFileAttachment>>,
}

// make a new() method for MessageSendSchema
impl MessageSendSchema {
    pub fn new(
        message_type: Option<i32>,
        content: Option<String>,
        nonce: Option<String>,
        tts: Option<bool>,
        embeds: Option<Vec<Embed>>,
        allowed_mentions: Option<AllowedMention>,
        message_reference: Option<MessageReference>,
        components: Option<Vec<Component>>,
        sticker_ids: Option<Vec<String>>,
        attachments: Option<Vec<PartialDiscordFileAttachment>>,
    ) -> MessageSendSchema {
        MessageSendSchema {
            message_type,
            content,
            nonce,
            tts,
            embeds,
            allowed_mentions,
            message_reference,
            components,
            sticker_ids,
            attachments,
        }
    }
}