dto

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	ContentType *string `json:"content_type,omitempty" example:"image/png"`                             // File mime type
	Filename    string  `json:"filename" example:"image.png"`                                           // File name
	Height      *int64  `json:"height,omitempty" example:"600"`                                         // Image dimensions in pixels
	Width       *int64  `json:"width,omitempty" example:"800"`                                          // Image dimensions in pixels
	URL         string  `json:"url" example:"https://example.com/image.png"`                            // URL to download the file
	PreviewURL  *string `json:"preview_url,omitempty" example:"https://example.com/image_preview.webp"` // Preview URL for image/video
	Size        int64   `json:"size" example:"1000000"`                                                 // FileSize in bytes
}

type AttachmentUpload

type AttachmentUpload struct {
	Id        int64  `json:"id" example:"2230469276416868352"`         // Attachment ID
	ChannelId int64  `json:"channel_id" example:"2230469276416868352"` // Channel ID the attachment was sent to
	FileName  string `json:"file_name" example:"image.png"`            // File name

}

type Avatar added in v1.5.0

type Avatar struct {
	Id          int64   `json:"id" example:"2230469276416868352"`
	URL         string  `json:"url" example:"https://cdn.example.com/avatars/2230/2231.webp"`
	ContentType *string `json:"content_type,omitempty" example:"image/webp"`
	Width       *int64  `json:"width,omitempty" example:"128"`
	Height      *int64  `json:"height,omitempty" example:"128"`
	Size        int64   `json:"size" example:"245678"`
}

Avatar represents a stored avatar item with its ID and metadata

type AvatarData added in v1.5.0

type AvatarData struct {
	Id          int64   `json:"id" example:"2230469276416868352"`
	URL         string  `json:"url" example:"https://cdn.example.com/avatars/2230/2231.webp"`
	ContentType *string `json:"content_type,omitempty" example:"image/webp"`
	Width       *int64  `json:"width,omitempty" example:"128"`
	Height      *int64  `json:"height,omitempty" example:"128"`
	Size        int64   `json:"size" example:"245678"`
}

AvatarData is returned with user profile to describe active avatar

type AvatarUpload added in v1.5.0

type AvatarUpload struct {
	Id     int64 `json:"id" example:"2230469276416868352"`
	UserId int64 `json:"user_id" example:"2230469276416868352"`
}

type Channel

type Channel struct {
	Id            int64             `json:"id" example:"2230469276416868352"`                       // Channel ID
	Type          model.ChannelType `json:"type" example:"0"`                                       // Channel type
	GuildId       *int64            `json:"guild_id,omitempty" example:"2230469276416868352"`       // Guild ID channel was created in
	ParticipantId *int64            `json:"participant_id,omitempty" example:"2230469276416868352"` // For DM channels: the other participant's user ID
	CreatorId     *int64            `json:"creator_id,omitempty" example:"2230469276416868352"`     // For threads: user who created the thread
	Member        *ThreadMember     `json:"member,omitempty"`                                       // For threads: current user's membership state when returned via HTTP.
	MemberIds     []int64           `json:"member_ids,omitempty" example:"2230469276416868352"`     // For threads: IDs of users who have joined the thread.
	Name          string            `json:"name" example:"channel-name"`                            // Channel name, without spaces
	ParentId      *int64            `json:"parent_id,omitempty" example:"2230469276416868352"`      // Parent channel id
	Position      int               `json:"position" example:"4"`                                   // Channel position
	Topic         *string           `json:"topic" example:"Just a channel topic"`                   // Channel topic.
	Permissions   *int64            `json:"permissions,omitempty"`                                  // Permissions. Check the permissions documentation for more info.
	Private       bool              `json:"private" default:"false"`                                // Whether the channel is private. Private channels can only be seen by users with roles assigned to this channel.
	Closed        bool              `json:"closed"`                                                 // Whether the thread is closed for new messages.
	Roles         []int64           `json:"roles,omitempty" example:"2230469276416868352"`          // Roles IDs
	LastMessageId int64             `json:"last_message_id" example:"2230469276416868352"`          // ID of the last message in the channel
	MessageCount  *int64            `json:"message_count,omitempty" example:"42"`                   // For threads: approximate stored message count.
	VoiceRegion   *string           `json:"voice_region,omitempty" example:"us-east"`               // Voice channel region
	CreatedAt     time.Time         `json:"created_at"`                                             // Timestamp of channel creation
}

type ChannelOrder

type ChannelOrder struct {
	Id       int64 `json:"id"`       // Channel ID.
	Position int   `json:"position"` // New channel position.
}

type EmojiRef added in v1.7.0

type EmojiRef struct {
	Name string `json:"name"`
	Id   int64  `json:"id,string"`
}

type EmojiUpload added in v1.7.0

type EmojiUpload struct {
	Id      int64  `json:"id,string"`
	GuildId int64  `json:"guild_id,string"`
	Name    string `json:"name"`
}

type Guild

type Guild struct {
	Id          int64  `json:"id" example:"2230469276416868352"`    // Guild ID
	Name        string `json:"name" example:"My Guild"`             // Guild Name
	Icon        *Icon  `json:"icon,omitempty"`                      // Icon metadata
	Owner       int64  `json:"owner" example:"2230469276416868352"` // Owner ID
	Public      bool   `json:"public" default:"false"`              // Whether the guild is public
	Permissions int64  `json:"permissions" default:"7927905"`       // Default guild Permissions. Check the permissions documentation for more info.
}

type GuildBan added in v1.7.0

type GuildBan struct {
	User   User    `json:"user"`
	Reason *string `json:"reason,omitempty"`
}

type GuildEmoji added in v1.7.0

type GuildEmoji struct {
	Id       int64  `json:"id,string"`
	GuildId  int64  `json:"guild_id,string"`
	Name     string `json:"name"`
	Animated bool   `json:"animated"`
}

type GuildInvite

type GuildInvite struct {
	Id        int64     `json:"id"`
	Code      string    `json:"code"`
	GuildId   int64     `json:"guild_id"`
	AuthorId  int64     `json:"author_id"`
	CreatedAt time.Time `json:"created_at"`
	ExpiresAt time.Time `json:"expires_at"`
}

type Icon added in v1.5.0

type Icon struct {
	Id       int64  `json:"id" example:"2230469276416868352"`
	URL      string `json:"url" example:"https://cdn.example.com/icons/2230/2231.webp"`
	Filesize int64  `json:"filesize" example:"12345"`
	Width    int64  `json:"width" example:"128"`
	Height   int64  `json:"height" example:"128"`
}

Icon is a full guild icon description returned in guild payloads

type IconUpload added in v1.5.0

type IconUpload struct {
	Id      int64 `json:"id" example:"2230469276416868352"`
	GuildId int64 `json:"guild_id" example:"2230469276416868352"`
}

IconUpload describes newly created guild icon placeholder

type IndexDeleteMessage

type IndexDeleteMessage struct {
	ChannelId int64 `json:"channel_id"`
	MessageId int64 `json:"message_id"`
}

type IndexMessage

type IndexMessage struct {
	MessageId int64  `json:"message_id"`
	UserId    int64  `json:"user_id"`
	ChannelId int64  `json:"channel_id"`
	GuildId   *int64 `json:"guild_id"`
	// Mentions contains users IDs
	Mentions []int64 `json:"mentions"`
	// Has is a list of features that the message contains (url, image, video, file)
	Has     []string `json:"has"`
	Type    int      `json:"type"`
	Content string   `json:"content"`
}

IndexMessage is a structure with message data that the search engine will index and search by

type InvitePreview

type InvitePreview struct {
	Id           int64     `json:"id"`
	Code         string    `json:"code"`
	Guild        Guild     `json:"guild"`
	AuthorId     int64     `json:"author_id"`
	CreatedAt    time.Time `json:"created_at"`
	ExpiresAt    time.Time `json:"expires_at"`
	MembersCount int       `json:"members_count"`
}

type Member

type Member struct {
	User     User      `json:"user"`                                          // Guild member data
	Username *string   `json:"username" example:"FancyUserName"`              // Username in this guild
	Avatar   *int64    `json:"avatar" example:"2230469276416868352"`          // Avatar ID
	JoinAt   time.Time `json:"join_at"`                                       // Join date
	Roles    []int64   `json:"roles,omitempty" example:"2230469276416868352"` // List of assigned role IDs
}

type Message

type Message struct {
	Id                 int64                `json:"id" example:"2230469276416868352"`         // Message ID
	ChannelId          int64                `json:"channel_id" example:"2230469276416868352"` // Channel id the message was sent to
	Author             User                 `json:"author"`
	Content            string               `json:"content" example:"Hello world!"`
	Position           *int64               `json:"position,omitempty" example:"512"`                       // Monotonic channel-local message position used for navigation.
	Nonce              *helper.MessageNonce `json:"nonce,omitempty" swaggertype:"string" example:"draft-1"` // Ephemeral client correlation token echoed only to the author.
	Attachments        []Attachment         `json:"attachments,omitempty"`
	Embeds             []embed.Embed        `json:"embeds,omitempty"`
	Flags              int                  `json:"flags,omitempty"` // Bitmask. Includes suppress-embeds and banned-author markers in API responses.
	Type               int                  `json:"type" example:"0"`
	Reference          *int64               `json:"reference,omitempty" example:"2230469276416868352"`            // Referenced source message id.
	ReferenceChannelId *int64               `json:"reference_channel_id,omitempty" example:"2230469276416868352"` // Channel id of the referenced source message.
	ThreadId           *int64               `json:"thread_id,omitempty" example:"2230469276416868352"`            // Thread linked from this message.
	Thread             *Channel             `json:"thread,omitempty"`                                             // Thread metadata when the message is linked to a thread.
	UpdatedAt          *time.Time           `json:"updated_at,omitempty"`                                         // Timestamp of the last message edit
}

type Role

type Role struct {
	Id          int64  `json:"id" example:"2230469276416868352"`       // Role ID
	GuildId     int64  `json:"guild_id" example:"2230469276416868352"` // Guild ID
	Name        string `json:"name" example:"role-name"`               // Role name
	Color       int    `json:"color"`                                  // Role color. Will change username color. Represent RGB color in one Integer value.
	Permissions int64  `json:"permissions"`                            // Role permissions. Check the permissions documentation for more info.
	Position    int    `json:"position" example:"0"`                   // Role position. Lower values are shown first in guild role lists.
}

type ThreadMember added in v1.8.0

type ThreadMember struct {
	UserId        int64     `json:"user_id" example:"2230469276416868352"`
	JoinTimestamp time.Time `json:"join_timestamp"`
	Flags         int       `json:"flags"`
}

type User

type User struct {
	Id            int64       `json:"id" example:"2230469276416868352"`
	Name          string      `json:"name" example:"FancyUserName"`
	Discriminator string      `json:"discriminator" example:"uniquename"`
	Bio           *string     `json:"bio" example:"Building gochat one endpoint at a time"`
	BannerColor   *int        `json:"banner_color" example:"3447003"`
	PanelColor    *int        `json:"panel_color" example:"15158332"`
	Avatar        *AvatarData `json:"avatar,omitempty"`
}

Jump to

Keyboard shortcuts

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