model

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageFlagSuppressEmbeds = 1 << 2
	MessageFlagBannedAuthor   = 1 << 3
)

Variables

This section is empty.

Functions

func HasMessageFlag added in v1.7.0

func HasMessageFlag(flags, flag int) bool

func IsEditableMessageType added in v1.8.0

func IsEditableMessageType(msgType MessageType) bool

func NormalizeMessageFlags added in v1.7.0

func NormalizeMessageFlags(flags *int) int

Types

type Attachment

type Attachment struct {
	Id          int64
	ChannelId   int64
	Name        string
	FileSize    int64
	ContentType *string
	Height      *int64
	Width       *int64
	URL         *string
	PreviewURL  *string
	AuthorId    *int64
	Done        bool
}

type Audit

type Audit struct {
	GuildId   int64             `db:"guild_id"`
	CreatedAt time.Time         `db:"created_at"`
	Changes   map[string]string `db:"changes"`
}

type Authentication

type Authentication struct {
	UserId       int64     `db:"user_id"`
	Email        string    `db:"email"`
	PasswordHash string    `db:"password_hash"`
	CreatedAt    time.Time `db:"created_at"`
}

type Avatar

type Avatar struct {
	Id          int64
	UserId      int64
	URL         *string
	ContentType *string
	Width       *int64
	Height      *int64
	FileSize    int64
	Done        bool
}

type Channel

type Channel struct {
	Id              int64       `db:"id"`
	Name            string      `db:"name"`
	Type            ChannelType `db:"type"`
	ParentID        *int64      `db:"parent_id"`
	CreatorID       *int64      `db:"creator_id"`
	Permissions     *int64      `db:"permissions"`
	Topic           *string     `db:"topic"`
	VoiceRegion     *string     `db:"voice_region"`
	Private         bool        `db:"private"`
	Closed          bool        `db:"closed"`
	LastMessage     int64       `db:"last_message"`
	MessageCount    int64       `db:"message_count"`
	MessagePosition int64       `db:"message_position"`
	CreatedAt       time.Time   `db:"created_at"`
}

type ChannelMention added in v1.5.0

type ChannelMention struct {
	GuildId   int64
	ChannelId int64
	MessageId int64
	AuthorId  int64
	RoleId    *int64
	Type      int
}

type ChannelMentionType added in v1.5.0

type ChannelMentionType int
const (
	ChannelMentionUser ChannelMentionType = iota
	ChannelMentionRole
	ChannelMentionEveryone
	ChannelMentionHere
)

type ChannelRoles added in v1.4.0

type ChannelRoles struct {
	ChannelId int64         `db:"channel_id"`
	Roles     pq.Int64Array `db:"roles"`
}

type ChannelRolesPermission

type ChannelRolesPermission struct {
	ChannelId int64 `db:"channel_id"`
	RoleId    int64 `db:"role_id"`
	Accept    int64 `db:"accept"`
	Deny      int64 `db:"deny"`
}

type ChannelType

type ChannelType int
const (
	ChannelTypeGuild         ChannelType = iota // Default text channel in guild
	ChannelTypeGuildVoice                       // Voice channel in guild
	ChannelTypeGuildCategory                    // Category channel in guild
	ChannelTypeDM                               // DM channel. Can't be created in Guild
	ChannelTypeGroupDM                          // Group DM channel. Can't be created in Guild'
	ChannelTypeThread                           // Thread channel
)

type ChannelUserPermission

type ChannelUserPermission struct {
	ChannelId int64 `db:"channel_id"`
	UserId    int64 `db:"user_id"`
	Accept    int64 `db:"accept"`
	Deny      int64 `db:"deny"`
}

type DMChannel

type DMChannel struct {
	UserId        int64 `db:"user_id"`
	ParticipantId int64 `db:"participant_id"`
	ChannelId     int64 `db:"channel_id"`
}

type Devices added in v1.5.0

type Devices struct {
	AudioInputDevice    string  `json:"audio_input_device"`
	AudioOutputDevice   string  `json:"audio_output_device"`
	VideoDevice         string  `json:"video_device"`
	NoiseSuppression    bool    `json:"noise_suppression"`
	DenoiserType        string  `json:"denoiser_type"`
	EchoCancellation    bool    `json:"echo_cancellation"`
	AudioInputLevel     float64 `json:"audio_input_level"`
	AudioOutputLevel    float64 `json:"audio_output_level"`
	AudioInputThreshold float64 `json:"audio_input_threshold"`
	AutoGainControl     bool    `json:"auto_gain_control"`
}

func (Devices) Validate added in v1.5.0

func (d Devices) Validate() error

type Discriminator

type Discriminator struct {
	UserId        int64  `db:"user_id"`
	Discriminator string `db:"discriminator"`
}

type EmojiLookup added in v1.7.0

type EmojiLookup struct {
	Id        int64     `db:"id"`
	GuildId   int64     `db:"guild_id"`
	Name      string    `db:"name"`
	Done      bool      `db:"done"`
	Animated  bool      `db:"animated"`
	Width     *int64    `db:"width"`
	Height    *int64    `db:"height"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

type Friend

type Friend struct {
	UserID    int64     `db:"user_id"`
	FriendID  int64     `db:"friend_id"`
	CreatedAt time.Time `db:"created_at"`
}

type FriendRequest added in v1.5.0

type FriendRequest struct {
	UserId   int64 `db:"user_id"`
	FriendId int64 `db:"friend_id"`
}

type GroupDMChannel

type GroupDMChannel struct {
	ChannelId int64 `db:"channel_id"`
	UserId    int64 `db:"user_id"`
}

type Guild

type Guild struct {
	Id             int64     `db:"id"`
	Name           string    `db:"name"`
	OwnerId        int64     `db:"owner_id"`
	Icon           *int64    `db:"icon"`
	Public         bool      `db:"public"`
	Permissions    int64     `db:"permissions"`
	CreatedAt      time.Time `db:"created_at"`
	SystemMessages *int64    `db:"system_messages"`
}

type GuildBan added in v1.7.0

type GuildBan struct {
	GuildId int64
	UserId  int64
	Reason  *string
}

type GuildChannel

type GuildChannel struct {
	GuildId   int64 `db:"guild_id"`
	ChannelId int64 `db:"channel_id"`
	Position  int   `db:"position"`
}

type GuildChannelUpdatePosition

type GuildChannelUpdatePosition struct {
	GuildId   int64
	ChannelId int64
	Position  int
}

type GuildEmoji added in v1.7.0

type GuildEmoji struct {
	GuildId          int64     `db:"guild_id"`
	Id               int64     `db:"id"`
	Name             string    `db:"name"`
	NameNormalized   string    `db:"name_normalized"`
	CreatorId        int64     `db:"creator_id"`
	Done             bool      `db:"done"`
	Animated         bool      `db:"animated"`
	DeclaredFileSize int64     `db:"declared_file_size"`
	ActualFileSize   *int64    `db:"actual_file_size"`
	ContentType      *string   `db:"content_type"`
	Width            *int64    `db:"width"`
	Height           *int64    `db:"height"`
	UploadExpiresAt  time.Time `db:"upload_expires_at"`
	CreatedAt        time.Time `db:"created_at"`
	UpdatedAt        time.Time `db:"updated_at"`
}

type GuildInvite

type GuildInvite struct {
	InviteCode string    `db:"invite_code"`
	InviteId   int64     `db:"invite_id"`
	GuildId    int64     `db:"guild_id"`
	AuthorId   int64     `db:"author_id"`
	CreatedAt  time.Time `db:"created_at"`
	ExpiresAt  time.Time `db:"expires_at"`
}

GuildInvite represents an invite joined with its code and metadata

type Icon

type Icon struct {
	Id          int64
	GuildId     int64
	URL         *string
	ContentType *string
	Width       *int64
	Height      *int64
	FileSize    int64
	Done        bool
}

type Member

type Member struct {
	UserId   int64     `db:"user_id"`
	GuildId  int64     `db:"guild_id"`
	Username *string   `db:"username"`
	Avatar   *int64    `db:"avatar"`
	JoinAt   time.Time `db:"join_at"`
	Timeout  time.Time `db:"timeout"`
}

type Mention added in v1.5.0

type Mention struct {
	UserId    int64
	ChannelId int64
	MessageId int64
	AuthorId  int64
}

type Message

type Message struct {
	Id               int64
	ChannelId        int64
	UserId           int64
	Content          string
	Position         int64
	Attachments      []int64
	EmbedsJSON       *string
	AutoEmbedsJSON   *string
	Flags            *int
	Type             int
	ReferenceChannel int64
	Reference        int64
	Thread           int64
	EditedAt         *time.Time
}

type MessageType

type MessageType int
const (
	MessageTypeChat MessageType = iota
	MessageTypeReply
	MessageTypeJoin
	MessageTypeThreadCreated
	MessageTypeThreadInitial
)

type NotificationsType added in v1.4.0

type NotificationsType int
const (
	NotificationsAll NotificationsType = iota
	NotificationsMentions
	NotificationsNone
)

type Reaction

type Reaction struct {
	MessageId int64
	UserId    int64
	EmoteId   int64
}

type Recovery

type Recovery struct {
	UserId    int64     `db:"user_id"`
	Token     string    `db:"token"`
	ExpiresAt time.Time `db:"expires_at"`
	CreatedAt time.Time `db:"created_at"`
}

type Registration

type Registration struct {
	UserId            int64     `db:"user_id"`
	Email             string    `db:"email"`
	ConfirmationToken string    `db:"confirmation_token"`
	CreatedAt         time.Time `db:"created_at"`
}

type Role

type Role struct {
	Id          int64  `db:"id"`
	GuildId     int64  `db:"guild_id"`
	Name        string `db:"name"`
	Color       int    `db:"color"`
	Permissions int64  `db:"permissions"`
	Position    int    `db:"position"`
}

type RoleUpdatePosition added in v1.7.0

type RoleUpdatePosition struct {
	GuildId  int64
	RoleId   int64
	Position int
}

type Status added in v1.5.0

type Status struct {
	Status           string `json:"status"`
	CustomStatusText string `json:"custom_status_text,omitempty"`
}

func (Status) Validate added in v1.5.0

func (s Status) Validate() error

type ThreadMember added in v1.8.0

type ThreadMember struct {
	ThreadId int64     `db:"thread_id"`
	UserId   int64     `db:"user_id"`
	Flags    int       `db:"flags"`
	JoinAt   time.Time `db:"join_at"`
}

type User

type User struct {
	Id          int64     `json:"id" db:"id"`
	Name        string    `json:"name" db:"name"`
	Bio         *string   `json:"bio" db:"bio"`
	BannerColor *int      `json:"banner_color" db:"banner_color"`
	PanelColor  *int      `json:"panel_color" db:"panel_color"`
	Avatar      *int64    `json:"avatar" db:"avatar"`
	Blocked     bool      `json:"blocked" db:"blocked"`
	UploadLimit *int64    `json:"upload_limit" db:"upload_limit"`
	CreatedAt   time.Time `json:"created_at" db:"created_at"`
}

type UserDMChannels added in v1.5.0

type UserDMChannels struct {
	UserId      int64 `json:"user_id"`
	ChannelId   int64 `json:"channel_id"`
	Hidden      bool  `json:"hidden"`
	HiddenAfter int64 `json:"hidden_after"`
}

type UserGuild

type UserGuild struct {
	UserId  int64 `db:"user_id"`
	GuildId int64 `db:"guild_id"`
}

type UserRole

type UserRole struct {
	GuildId int64 `db:"guild_id"`
	UserId  int64 `db:"user_id"`
	RoleId  int64 `db:"role_id"`
}

type UserRoles added in v1.4.0

type UserRoles struct {
	UserId int64         `db:"user_id"`
	Roles  pq.Int64Array `db:"roles"`
}

type UserSettings added in v1.4.0

type UserSettings struct {
	UserId   int64           `db:"user_id,string"`
	Settings json.RawMessage `db:"settings"`
	Version  int64           `db:"version,string"`
}

type UserSettingsAppearance added in v1.4.0

type UserSettingsAppearance struct {
	ColorScheme   string  `json:"color_scheme"`
	ChatSpacing   float32 `json:"chat_spacing"`
	ChatFontScale float32 `json:"chat_font_scale"`
}

type UserSettingsChannel added in v1.5.0

type UserSettingsChannel struct {
	ChannelId     int64                     `json:"channel_id"`
	Notifications UserSettingsNotifications `json:"notifications"`
}

type UserSettingsData added in v1.4.0

type UserSettingsData struct {
	Language         string                     `json:"language"`
	Appearance       UserSettingsAppearance     `json:"appearance"`
	GuildFolders     []UserSettingsGuildFolders `json:"guild_folders"`
	Guilds           []UserSettingsGuilds       `json:"guilds"`
	ChannelsSettings []UserSettingsChannel      `json:"channels"`
	UsersSettings    []UserSettingsUsers        `json:"users"`
	FavoriteGifs     []string                   `json:"favorite_gifs"`
	ForcedPresence   string                     `json:"forced_presence"`
	Status           Status                     `json:"status"`
	DMChannels       []UserDMChannels           `json:"dm_channels"`
	Devices          Devices                    `json:"devices"`
	UISounds         UserUISounds               `json:"ui_sounds"`
}

func (UserSettingsData) Validate added in v1.4.0

func (s UserSettingsData) Validate() error

type UserSettingsGuildFolders added in v1.4.0

type UserSettingsGuildFolders struct {
	Name     string                  `json:"name"`
	Color    int64                   `json:"color"`
	Position int64                   `json:"position"`
	Guilds   helper.StringInt64Array `json:"guilds"`
}

type UserSettingsGuilds added in v1.4.0

type UserSettingsGuilds struct {
	GuildId         helper.StringInt64        `json:"guild_id"`
	Position        int64                     `json:"position"`
	SelectedChannel helper.StringInt64        `json:"selected_channel"`
	Notifications   UserSettingsNotifications `json:"notifications"`
}

func (UserSettingsGuilds) Validate added in v1.4.0

func (g UserSettingsGuilds) Validate() error

type UserSettingsNotifications added in v1.4.0

type UserSettingsNotifications struct {
	Muted         bool              `json:"muted"`
	MutedUntil    *time.Time        `json:"muted_until,omitempty"`
	Notifications NotificationsType `json:"notifications"`
}

func (UserSettingsNotifications) Validate added in v1.4.0

func (n UserSettingsNotifications) Validate() error

type UserSettingsUsers added in v1.5.0

type UserSettingsUsers struct {
	UserId        int64                     `json:"user_id"`
	Notifications UserSettingsNotifications `json:"notifications"`
}

type UserUISounds added in v1.5.0

type UserUISounds struct {
	Mute         *bool `json:"mute,omitempty"`
	Deafen       *bool `json:"deafen,omitempty"`
	VoiceChannel *bool `json:"voice_channel,omitempty"`
	Notification *bool `json:"notification,omitempty"`
}

Jump to

Keyboard shortcuts

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