user

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrUnableToGetUserToken          = "unable to get user token"
	ErrBadRequest                    = "incorrect request"
	ErrUnableToParseID               = "unable to parse id"
	ErrUnableToGetUser               = "unable to get user"
	ErrUnableToGetDiscriminator      = "unable to get user discriminator"
	ErrUnableToModifyUser            = "unable to modify user"
	ErrUnableToGetMember             = "unable to get member"
	ErrUnableToGetRoles              = "unable to get roles"
	ErrUnableToGetGuildByID          = "unable to get guild by id"
	ErrUnableToGetGuilds             = "unable to get guilds"
	ErrUnableToGetUserGuilds         = "unable to get user guilds"
	ErrUnableToLeaveOwnServer        = "unable to leave own guild"
	ErrUnableToRemoveMember          = "unable to remove member"
	ErrUnableToParseRequestBody      = "unable to parse request body"
	ErrUnableToCreateChannel         = "unable to create channel"
	ErrUnableToCreateDMChannel       = "unable to create dm channel"
	ErrUnableToGetChannel            = "unable to get channel"
	ErrUnableToGetDMChannel          = "unable to get dm channel"
	ErrUnableToGetGroupDMChannel     = "unable to get group dm channel"
	ErrUnableToJoingGroupDmChannel   = "unable to join group dm channel"
	ErrUnableToGetUserSettings       = "unable to get user settings"
	ErrUnableToSetUserSettings       = "unable to set user settings"
	ErrUnableToUnmarshalUserSettings = "unable to unmarshal user settings"
	ErrUnableToParseVersion          = "unable to parse version"
	ErrUnableToGetReadStates         = "unable to get read states"
	ErrUnableToGetMembership         = "unable to get membership"

	// Validation error messages
	ErrUserNameTooShort           = "user name must be at least 4 characters"
	ErrUserNameTooLong            = "user name must be less than 20 characters"
	ErrAvatarIdInvalid            = "avatar ID must be positive"
	ErrRecipientIdRequired        = "recipient ID is required"
	ErrRecipientIdInvalid         = "recipient ID must be positive"
	ErrChannelIdInvalid           = "channel ID must be positive"
	ErrRecipientsRequired         = "at least one recipient is required"
	ErrRecipientsInvalid          = "recipient IDs must be positive"
	ErrTooManyRecipients          = "maximum 10 recipients allowed"
	ErrUnableToDeleteActiveAvatar = "unable to delete active avatar"
	ErrNoFieldsToUpdate           = "at least one field must be provided for update"
)
View Source
const (
	ErrUnableToGetFriends           = "unable to get friends"
	ErrUnableToCreateFriendRequest  = "unable to create friend request"
	ErrUnableToRemoveFriend         = "unable to remove friend"
	ErrUnableToGetFriendRequests    = "unable to get friend requests"
	ErrUnableToAcceptFriendRequest  = "unable to accept friend request"
	ErrUnableToDeclineFriendRequest = "unable to decline friend request"
)

Friend-related errors

Variables

This section is empty.

Functions

func New

func New(cql *db.CQLCon, pg *pgdb.DB, mqt mq.SendTransporter, cache cache.Cache, attachTTLSeconds int64, log *slog.Logger) server.Entity

Types

type CreateAvatarRequest added in v1.5.0

type CreateAvatarRequest struct {
	FileSize    int64  `json:"file_size" example:"120000"`
	ContentType string `json:"content_type" example:"image/png"`
}

Request for creating avatar metadata

func (CreateAvatarRequest) Validate added in v1.5.0

func (r CreateAvatarRequest) Validate() error

Validate constraints: <= 250KB and image/*

type CreateDMManyRequest

type CreateDMManyRequest struct {
	ChannelId    *int64  `json:"channel_id"`
	RecipientsId []int64 `json:"recipients_id"`
}

func (CreateDMManyRequest) Validate

func (r CreateDMManyRequest) Validate() error

type CreateDMRequest

type CreateDMRequest struct {
	RecipientId int64 `json:"recipient_id"`
}

func (CreateDMRequest) Validate

func (r CreateDMRequest) Validate() error

type CreateFriendRequestRequest added in v1.5.0

type CreateFriendRequestRequest struct {
	Discriminator string `json:"discriminator"`
}

Payloads for friend operations

func (CreateFriendRequestRequest) Validate added in v1.5.0

func (r CreateFriendRequestRequest) Validate() error

type DMChannelsLastRequest added in v1.5.0

type DMChannelsLastRequest struct {
	ChannelIds []int64 `json:"channel_ids"`
}

DM channels last messages request

func (DMChannelsLastRequest) Validate added in v1.5.0

func (r DMChannelsLastRequest) Validate() error

type FriendRequestAction added in v1.5.0

type FriendRequestAction struct {
	UserId int64 `json:"user_id"`
}

func (FriendRequestAction) Validate added in v1.5.0

func (r FriendRequestAction) Validate() error

type ModifyUserRequest

type ModifyUserRequest struct {
	Avatar *int64  `json:"avatar,omitempty" example:"2230469276416868352"` // Avatar ID.
	Name   *string `json:"name,omitempty" example:"NewFancyName"`          // User name.
}

func (ModifyUserRequest) Validate

func (r ModifyUserRequest) Validate() error

type UnfriendRequest added in v1.5.0

type UnfriendRequest struct {
	UserId int64 `json:"user_id"`
}

func (UnfriendRequest) Validate added in v1.5.0

func (r UnfriendRequest) Validate() error

type UserSettingsResponse added in v1.4.0

type UserSettingsResponse struct {
	Version            int64                            `json:"version"`
	Settings           *model.UserSettingsData          `json:"settings"`
	ReadStates         map[int64]int64                  `json:"read_states"`
	GuildsLastMessages map[int64]map[int64]int64        `json:"guilds_last_messages"`
	Guilds             []dto.Guild                      `json:"guilds"`
	Mentions           map[int64][]model.Mention        `json:"mentions,omitempty"`
	ChannelMentions    map[int64][]model.ChannelMention `json:"channel_mentions,omitempty"`
}

Jump to

Keyboard shortcuts

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