diff --git a/webhook/main.go b/webhook/main.go deleted file mode 100644 index f187b74..0000000 --- a/webhook/main.go +++ /dev/null @@ -1,19 +0,0 @@ -package webhook - -import ( - "bytes" - "errors" - "net/http" -) - -func Webhook(url string, webhook []byte) (error, bool) { - if resp, err := http.Post(url, "application/json", bytes.NewBuffer(webhook)); err != nil { - return err, false - } else { - if resp.StatusCode == 204 { - return nil, true - } else { - return errors.New("[Error] unable to send webhook " + resp.Status), false - } - } -} diff --git a/webhook/types.go b/webhook/types.go deleted file mode 100644 index 341221c..0000000 --- a/webhook/types.go +++ /dev/null @@ -1,44 +0,0 @@ -package webhook - -type Web struct { - Content string `json:"content"` - Embeds []Embeds `json:"embeds"` - Username string `json:"username"` - AvatarURL string `json:"avatar_url"` -} - -type Embeds struct { - Description string `json:"description"` - URL string `json:"url"` - Image Image `json:"image"` - Thumbnail Thumbnail `json:"thumbnail"` - Fields []Fields `json:"fields"` - Color int `json:"color"` - Author Author `json:"author"` - Footer Footer `json:"footer"` -} - -type Fields struct { - Name string `json:"name"` - Value string `json:"value"` - Inline bool `json:"inline"` -} - -type Footer struct { - Text string `json:"text"` - IconURL string `json:"icon_url"` -} - -type Author struct { - Name string `json:"name"` - URL string `json:"url"` - IconURL string `json:"icon_url"` -} - -type Image struct { - URL string `json:"url"` -} - -type Thumbnail struct { - URL string `json:"url"` -}