custom discord hook

This commit is contained in:
Sotirios Pupakis
2025-09-06 02:34:26 +02:00
parent 1dd8b1105e
commit ae534a87dd
2 changed files with 77 additions and 2 deletions

27
models/discordhook.go Normal file
View File

@@ -0,0 +1,27 @@
package models
import (
"time"
)
type CustomImage struct {
URL string `json:"url,omitempty"`
}
// CustomEmbed mirrors the library's Embed but includes the Image field.
type CustomEmbed struct {
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"`
Timestamp time.Time `json:"timestamp,omitempty"`
Color int `json:"color,omitempty"`
Image CustomImage `json:"image,omitempty"` // Your new field
// You can add other fields like Footer, Author, Fields as needed.
}
// CustomHook is the top-level structure for the webhook payload.
type CustomHook struct {
Username string `json:"username,omitempty"`
Content string `json:"content,omitempty"`
Embeds []CustomEmbed `json:"embeds"`
}