Skip to content

Commit

Permalink
Add CreateEmbed::Field/s to 11_create_message_builder example (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
drklee3 authored and arqunis committed Jun 24, 2018
1 parent 5b66ace commit a9a2c27
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/11_create_message_builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a9a2c27

Please sign in to comment.