diff options
Diffstat (limited to 'bridge/discord/helpers.go')
-rw-r--r-- | bridge/discord/helpers.go | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/bridge/discord/helpers.go b/bridge/discord/helpers.go index 58676842..1447c530 100644 --- a/bridge/discord/helpers.go +++ b/bridge/discord/helpers.go @@ -1,7 +1,6 @@ package bdiscord import ( - "encoding/json" "errors" "regexp" "strings" @@ -236,26 +235,3 @@ func enumerateUsernames(s string) []string { } return usernames } - -// webhookExecute executes a webhook. -// webhookID: The ID of a webhook. -// token : The auth token for the webhook -// wait : Waits for server confirmation of message send and ensures that the return struct is populated (it is nil otherwise) -func (b *Bdiscord) webhookExecute(webhookID, token string, wait bool, data *discordgo.WebhookParams) (st *discordgo.Message, err error) { - uri := discordgo.EndpointWebhookToken(webhookID, token) - - if wait { - uri += "?wait=true" - } - response, err := b.c.RequestWithBucketID("POST", uri, data, discordgo.EndpointWebhookToken("", "")) - if !wait || err != nil { - return nil, err - } - - err = json.Unmarshal(response, &st) - if err != nil { - return nil, discordgo.ErrJSONUnmarshal - } - - return st, nil -} |