aboutsummaryrefslogtreecommitdiff
path: root/examples/11_create_message_builder/src
diff options
context:
space:
mode:
authorDerrick Lee <[email protected]>2018-06-24 12:20:54 -0700
committerAlex M. M <[email protected]>2018-06-24 21:20:54 +0200
commita9a2c27d7aefa6061dd9ca58a96c5ba617a78a6a (patch)
treec256d73ce28e990cbe3c96c51e85bfc9bb7759af /examples/11_create_message_builder/src
parentFix the notice of `field` (diff)
downloadserenity-a9a2c27d7aefa6061dd9ca58a96c5ba617a78a6a.tar.xz
serenity-a9a2c27d7aefa6061dd9ca58a96c5ba617a78a6a.zip
Add CreateEmbed::Field/s to 11_create_message_builder example (#338)
Diffstat (limited to 'examples/11_create_message_builder/src')
-rw-r--r--examples/11_create_message_builder/src/main.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/11_create_message_builder/src/main.rs b/examples/11_create_message_builder/src/main.rs
index 88be5a9..ff6a220 100644
--- a/examples/11_create_message_builder/src/main.rs
+++ b/examples/11_create_message_builder/src/main.rs
@@ -13,12 +13,17 @@ impl EventHandler for Handler {
// The create message builder allows you to easily create embeds and messages
// using a builder syntax.
// This example will create a message that says "Hello, World!", with an embed that has
- // a title, description, and footer.
+ // a title, description, three fields, and footer.
if let Err(why) = msg.channel_id.send_message(|m| m
.content("Hello, World!")
.embed(|e| e
.title("This is a title")
.description("This is a description")
+ .fields(vec![
+ ("This is the first field", "This is a field body", true),
+ ("This is the second field", "Both of these fields are inline", true),
+ ])
+ .field("This is the third field", "This is not an inline field", false)
.footer(|f| f
.text("This is a footer")))) {
println!("Error sending message: {:?}", why);