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
48
49
50
use internal::prelude::*;
use std::fmt::Display;
use super::CreateEmbed;
use utils::{self, VecMap};
#[derive(Clone, Debug, Default)]
pub struct EditMessage(pub VecMap<&'static str, Value>);
impl EditMessage {
#[inline]
pub fn content<D: Display>(self, content: D) -> Self {
self._content(content.to_string())
}
fn _content(mut self, content: String) -> Self {
self.0.insert("content", Value::String(content));
self
}
pub fn embed<F>(mut self, f: F) -> Self
where F: FnOnce(CreateEmbed) -> CreateEmbed {
let map = utils::vecmap_to_json_map(f(CreateEmbed::default()).0);
let embed = Value::Object(map);
self.0.insert("embed", embed);
self
}
}