1use super::utils::*;
2use serde::Serialize;
3
4#[derive(Serialize, Debug, Clone)]
5#[serde(tag = "type")]
6pub enum SendSegment {
7 #[serde(rename = "text")]
8 Text { data: TextData },
9
10 #[serde(rename = "face")]
11 Face { data: FaceData },
12
13 #[serde(rename = "image")]
14 Image { data: ImageData },
15
16 #[serde(rename = "record")]
17 Record { data: RecordData },
18
19 #[serde(rename = "video")]
20 Video { data: VideoData },
21
22 #[serde(rename = "at")]
23 At { data: AtData },
24
25 #[serde(rename = "rps")]
26 Rps { data: RpsData },
27
28 #[serde(rename = "dice")]
29 Dice { data: DiceData },
30
31 #[serde(rename = "shake")]
32 Shake { data: ShakeData },
33
34 #[serde(rename = "poke")]
35 Poke { data: PokeData },
36
37 #[serde(rename = "anonymous")]
38 Anonymous { data: AnonymousData },
39
40 #[serde(rename = "share")]
41 Share { data: ShareData },
42
43 #[serde(rename = "contact")]
44 Contact { data: ContactData },
45
46 #[serde(rename = "location")]
47 Location { data: LocationData },
48
49 #[serde(rename = "music")]
50 Music { data: MusicData },
51
52 #[serde(rename = "reply")]
53 Reply { data: ReplyData },
54
55 #[serde(rename = "forward")]
56 Forward { data: ForwardData },
57
58 #[serde(rename = "node")]
59 Node { data: NodeData },
60
61 #[serde(rename = "xml")]
62 Xml { data: XmlData },
63
64 #[serde(rename = "json")]
65 Json { data: JsonData },
66}
67
68#[derive(Serialize, Debug, Clone)]
69pub struct TextData {
70 pub text: String,
73}
74
75#[derive(Serialize, Debug, Clone)]
76pub struct FaceData {
77 pub id: String,
82}
83
84#[derive(Serialize, Debug, Clone)]
85pub struct ImageData {
86 pub file: String,
94 #[serde(rename = "type")]
95 pub image_type: Option<ImageType>,
100 pub cache: Option<bool>,
105 pub proxy: Option<bool>,
110 pub timeout: Option<i32>,
113}
114
115#[derive(Serialize, Debug, Clone)]
116pub struct RecordData {
117 pub file: String,
122 pub magic: String,
127 pub cache: Option<bool>,
132 pub proxy: Option<bool>,
137 pub timeout: Option<i32>,
140}
141
142#[derive(Serialize, Debug, Clone)]
143pub struct VideoData {
144 pub file: String,
149 pub cache: Option<bool>,
154 pub proxy: Option<bool>,
159 pub timeout: Option<i32>,
162}
163
164#[derive(Serialize, Debug, Clone)]
165pub struct AtData {
166 pub qq: AtType,
171}
172
173#[derive(Serialize, Debug, Clone)]
174pub struct RpsData {}
175
176#[derive(Serialize, Debug, Clone)]
177pub struct DiceData {}
178
179#[derive(Serialize, Debug, Clone)]
180pub struct ShakeData {}
181
182#[derive(Serialize, Debug, Clone)]
183pub struct PokeData {
184 #[serde(rename = "type")]
185 pub poke_type: String,
190 pub id: String,
195}
196
197#[derive(Serialize, Debug, Clone)]
198pub struct AnonymousData {
199 pub ignore: Option<bool>,
204}
205
206#[derive(Serialize, Debug, Clone)]
207pub struct ShareData {
208 pub url: String,
211 pub title: String,
214 pub content: String,
217 pub image: String,
220}
221
222#[derive(Serialize, Debug, Clone)]
223pub struct ContactData {
224 #[serde(rename = "type")]
225 pub contact_type: ContactType,
228 pub id: String,
231}
232
233#[derive(Serialize, Debug, Clone)]
234pub struct LocationData {
235 pub lat: String,
238 pub lon: String,
241 pub title: Option<String>,
244 pub content: Option<String>,
247}
248
249#[derive(Serialize, Debug, Clone)]
250pub struct MusicData {
251 #[serde(rename = "type")]
252 pub music_type: MusicType,
257 pub id: Option<String>,
260 pub url: Option<String>,
263 pub audio: Option<String>,
266 pub title: Option<String>,
269 pub content: Option<String>,
272 pub image: Option<String>,
275}
276
277#[derive(Serialize, Debug, Clone)]
278pub struct ReplyData {
279 pub id: String,
282}
283
284#[derive(Serialize, Debug, Clone)]
285pub struct ForwardData {}
286
287#[derive(Serialize, Debug, Clone)]
288pub struct NodeData {
289 pub id: Option<String>,
292 pub user_id: Option<String>,
295 pub nickname: Option<String>,
298 pub content: Option<Vec<SendSegment>>,
301}
302
303#[derive(Serialize, Debug, Clone)]
304pub struct XmlData {
305 pub data: String,
308}
309
310#[derive(Serialize, Debug, Clone)]
311pub struct JsonData {
312 pub data: String,
315}