From a9a2c27d7aefa6061dd9ca58a96c5ba617a78a6a Mon Sep 17 00:00:00 2001 From: Derrick Lee Date: Sun, 24 Jun 2018 12:20:54 -0700 Subject: Add CreateEmbed::Field/s to 11_create_message_builder example (#338) --- examples/11_create_message_builder/src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'examples/11_create_message_builder/src') 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); -- cgit v1.2.3