types

package
v0.0.0-...-1cd5ac2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TimeOrNil

func TimeOrNil(d *DateTimeLocal) *time.Time

Types

type Author

type Author struct {
	Name    *string `json:"name" validate:"omitempty,min=1,max=256"`
	IconUrl *string `json:"icon_url" validate:"omitempty,url,max=255"`
	Url     *string `json:"url" validate:"omitempty,url,max=255"`
}

type Colour

type Colour uint32

func (Colour) MarshalJSON

func (c Colour) MarshalJSON() ([]byte, error)

func (Colour) Uint32

func (c Colour) Uint32() uint32

func (*Colour) UnmarshalJSON

func (c *Colour) UnmarshalJSON(b []byte) error

type CustomEmbed

type CustomEmbed struct {
	Title        *string        `json:"title" validate:"omitempty,min=1,max=256"`
	Description  *string        `json:"description" validate:"omitempty,min=1,max=4096"`
	Url          *string        `json:"url" validate:"omitempty,url,max=255"`
	Colour       Colour         `json:"colour" validate:"gte=0,lte=16777215"`
	Author       Author         `json:"author" validate:"dive"`
	ImageUrl     *string        `json:"image_url" validate:"omitempty,max=255"`
	ThumbnailUrl *string        `json:"thumbnail_url" validate:"omitempty,max=255"`
	Footer       Footer         `json:"footer" validate:"dive"`
	Timestamp    *DateTimeLocal `json:"timestamp" validate:"omitempty"`
	Fields       []Field        `json:"fields" validate:"dive,max=25"`
}

func NewCustomEmbed

func NewCustomEmbed(c *database.CustomEmbed, fields []database.EmbedField) *CustomEmbed

func (*CustomEmbed) IntoDatabaseStruct

func (c *CustomEmbed) IntoDatabaseStruct() (*database.CustomEmbed, []database.EmbedField)

func (*CustomEmbed) IntoDiscordEmbed

func (c *CustomEmbed) IntoDiscordEmbed() *embed.Embed

func (*CustomEmbed) TotalCharacterCount

func (c *CustomEmbed) TotalCharacterCount() int

TotalCharacterCount returns the total number of characters in the embed

type DateTimeLocal

type DateTimeLocal time.Time

func NewDateTimeLocalFromPtr

func NewDateTimeLocalFromPtr(t *time.Time) *DateTimeLocal

func (DateTimeLocal) MarshalJSON

func (d DateTimeLocal) MarshalJSON() ([]byte, error)

func (DateTimeLocal) Time

func (d DateTimeLocal) Time() time.Time

func (*DateTimeLocal) UnmarshalJSON

func (d *DateTimeLocal) UnmarshalJSON(b []byte) error

type Emoji

type Emoji struct {
	IsCustomEmoji bool
	Name          string
	Id            *uint64
}

func NewEmoji

func NewEmoji(emojiName *string, emojiId *uint64) Emoji

func (Emoji) IntoGdl

func (e Emoji) IntoGdl() *emoji.Emoji

func (Emoji) MarshalJSON

func (e Emoji) MarshalJSON() ([]byte, error)

func (*Emoji) UnmarshalJSON

func (e *Emoji) UnmarshalJSON(data []byte) error

type Field

type Field struct {
	Name   string `json:"name" validate:"min=1,max=256"`
	Value  string `json:"value" validate:"min=1,max=1024"`
	Inline bool   `json:"inline"`
}
type Footer struct {
	Text    *string `json:"text" validate:"omitempty,min=1,max=2048"`
	IconUrl *string `json:"icon_url" validate:"omitempty,url,max=255"`
}

type Int64StringSlice

type Int64StringSlice []int64

func (Int64StringSlice) MarshalJSON

func (slice Int64StringSlice) MarshalJSON() ([]byte, error)

func (*Int64StringSlice) UnmarshalJSON

func (slice *Int64StringSlice) UnmarshalJSON(b []byte) error

type UInt64StringSlice

type UInt64StringSlice []uint64

func (UInt64StringSlice) MarshalJSON

func (slice UInt64StringSlice) MarshalJSON() ([]byte, error)

func (*UInt64StringSlice) UnmarshalJSON

func (slice *UInt64StringSlice) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL