1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-09-12 13:16:42 +00:00
arikawa/discord/webhook.go
2021-05-20 22:53:46 -07:00

30 lines
609 B
Go

package discord
import "time"
type Webhook struct {
ID WebhookID `json:"id"`
Type WebhookType `json:"type"`
User User `json:"user"` // creator
GuildID GuildID `json:"guild_id,omitempty"`
ChannelID ChannelID `json:"channel_id"`
Name string `json:"name"`
Avatar Hash `json:"avatar"`
Token string `json:"token"` // incoming webhooks only
}
// CreatedAt returns a time object representing when the webhook was created.
func (w Webhook) CreatedAt() time.Time {
return w.ID.Time()
}
type WebhookType uint8
const (
_ WebhookType = iota
IncomingWebhook
ChannelFollowerWebhook
)