You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

EmbedObjectBuilder.Inclusion.md 1.0 kB

7 years ago
12345678910111213141516171819202122232425
  1. The example will build a rich embed with an author field, a footer
  2. field, and 2 normal fields using an @Discord.EmbedBuilder:
  3. ```cs
  4. var exampleAuthor = new EmbedAuthorBuilder()
  5. .WithName("I am a bot")
  6. .WithIconUrl("https://discordapp.com/assets/e05ead6e6ebc08df9291738d0aa6986d.png");
  7. var exampleFooter = new EmbedFooterBuilder()
  8. .WithText("I am a nice footer")
  9. .WithIconUrl("https://discordapp.com/assets/28174a34e77bb5e5310ced9f95cb480b.png");
  10. var exampleField = new EmbedFieldBuilder()
  11. .WithName("Title of Another Field")
  12. .WithValue("I am an [example](https://example.com).")
  13. .WithInline(true);
  14. var otherField = new EmbedFieldBuilder()
  15. .WithName("Title of a Field")
  16. .WithValue("Notice how I'm inline with that other field next to me.")
  17. .WithInline(true);
  18. var embed = new EmbedBuilder()
  19. .AddField(exampleField)
  20. .AddField(otherField)
  21. .WithAuthor(exampleAuthor)
  22. .WithFooter(exampleFooter)
  23. .Build();
  24. ```