Browse Source

Add more embed example details

pull/988/head
Hsu Still 7 years ago
parent
commit
be5e309713
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
2 changed files with 24 additions and 11 deletions
  1. +24
    -11
      docs/_overwrites/Common/Discord.EmbedBuilder.Overwrites.md
  2. BIN
      docs/_overwrites/Common/images/embed-example.png

+ 24
- 11
docs/_overwrites/Common/Discord.EmbedBuilder.Overwrites.md View File

@@ -10,19 +10,32 @@ after @Discord.EmbedBuilder.Build* is called.

### Example

The example below builds an embed and sends it to the chat.

```cs
[Command("embed")]
public async Task SendRichEmbedAsync()
{
var embed = new EmbedBuilder
{
// Embed property can be set within object initializer
Title = "Hello world!"
}
// Or with the method
.WithTitle("I overwrote the title.")
.WithDescription("I am a description.")
.WithUrl("https://example.com")
.Build();
await _channel.SendMessageAsync(string.Empty, embed: embed);
{
// Embed property can be set within object initializer
Title = "Hello world!"
}
// Or with methods
.AddField("Field title",
"Field value. I also support [hyperlink markdown](https://example.com)!")
.WithAuthor(Context.Client.CurrentUser)
.WithFooter(footer => footer.Text = "I am a footer.")
.WithColor(Color.Blue)
.WithTitle("I overwrote \"Hello world!\"")
.WithDescription("I am a description.")
.WithUrl("https://example.com")
.WithCurrentTimestamp()
.Build();
await ReplyAsync(embed: embed);
}
```
```

#### Result

![Embed Example](images/embed-example.png)

BIN
docs/_overwrites/Common/images/embed-example.png View File

Before After
Width: 334  |  Height: 165  |  Size: 15 kB

Loading…
Cancel
Save