mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-07-19 18:58:51 +00:00
Fixed ExecuteEmbed
This commit is contained in:
parent
3154333310
commit
79567a9eff
|
@ -3,6 +3,7 @@ package api
|
||||||
import (
|
import (
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"github.com/diamondburned/arikawa/discord"
|
"github.com/diamondburned/arikawa/discord"
|
||||||
"github.com/diamondburned/arikawa/internal/httputil"
|
"github.com/diamondburned/arikawa/internal/httputil"
|
||||||
|
@ -100,9 +101,9 @@ func (c *Client) ExecuteWebhook(
|
||||||
webhookID discord.Snowflake, token string, wait bool,
|
webhookID discord.Snowflake, token string, wait bool,
|
||||||
data ExecuteWebhookData) (*discord.Message, error) {
|
data ExecuteWebhookData) (*discord.Message, error) {
|
||||||
|
|
||||||
if data.Embed != nil {
|
for i, embed := range data.Embeds {
|
||||||
if err := data.Embed.Validate(); err != nil {
|
if err := embed.Validate(); err != nil {
|
||||||
return nil, errors.Wrap(err, "Embed error")
|
return nil, errors.Wrap(err, "Embed error at "+strconv.Itoa(i))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue