diff options
| author | Zeyla Hellyer <[email protected]> | 2017-03-25 15:41:47 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-03-25 15:41:47 -0700 |
| commit | 9114963daf708cfaeaf54d8c788206ccfbae5df8 (patch) | |
| tree | 08d6aba5b8ad40189b312865ac776bb6fa30c45d /src/model/channel/embed.rs | |
| parent | Add slightly more documentation (diff) | |
| download | serenity-9114963daf708cfaeaf54d8c788206ccfbae5df8.tar.xz serenity-9114963daf708cfaeaf54d8c788206ccfbae5df8.zip | |
Rework the models directory
Diffstat (limited to 'src/model/channel/embed.rs')
| -rw-r--r-- | src/model/channel/embed.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/model/channel/embed.rs b/src/model/channel/embed.rs new file mode 100644 index 0000000..32c3722 --- /dev/null +++ b/src/model/channel/embed.rs @@ -0,0 +1,15 @@ +use serde_json::Value; +use ::model::Embed; +use ::utils::builder::CreateEmbed; + +impl Embed { + /// Creates a fake Embed, giving back a `serde_json` map. + /// + /// This should only be useful in conjunction with [`Webhook::execute`]. + /// + /// [`Webhook::execute`]: struct.Webhook.html + #[inline] + pub fn fake<F>(f: F) -> Value where F: FnOnce(CreateEmbed) -> CreateEmbed { + Value::Object(f(CreateEmbed::default()).0) + } +} |