new

package
v0.0.0-...-a9479ba Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppIDToMsgMapByMsgID

func AppIDToMsgMapByMsgID(c event.Context, msgID int) (map[int]model.Bind, error)

func AttachIDsInWaitingUpload

func AttachIDsInWaitingUpload(c event.Context, ids []int) ([]int, error)

func AttachmentToCbkAttachs

func AttachmentToCbkAttachs(attachs []*model.Attachment, waitingIDs []int) []callback.AttachmentNew

func CollectForwardExtAttachIDs

func CollectForwardExtAttachIDs(exts []ForwardExt) []int

func CollectMessageNewForwardsLocalIDs

func CollectMessageNewForwardsLocalIDs(fwds []Forward) []string

func Exec

func Exec(c event.Context, e Message) error

func ForwardExtToCbkForwards

func ForwardExtToCbkForwards(exts []ForwardExt, attachWaitingIDs []int) []callback.ForwardNew

func NewMsgResponseToBinds

func NewMsgResponseToBinds(responses []callback.MessageNewResponse) []*model.Bind

Types

type Attachment

type Attachment struct {
	LocalID    string `json:"local_id,omitempty"`
	HasSpoiler bool   `json:"has_spoiler,omitempty"`
	Type       int    `json:"type,omitempty"`
	// Общедоступная ссылка для загрузки файла.
	// Если ссылка не передана и по такому FileID не найдено файлов, то клиент должен будет загрузить файлы на специальный эндпоинт
	Url string `json:"url,omitempty"`
}

type Forward

type Forward struct {
	LocalID     string        `json:"local_id,omitempty"`
	Username    string        `json:"username,omitempty"`
	Text        string        `json:"text,omitempty"`
	CreateDate  string        `json:"create_date,omitempty"`
	Attachments []*Attachment `json:"attachments,omitempty"`
}

type ForwardExt

type ForwardExt struct {
	ID          int
	LocalID     string
	Username    string
	Text        string
	CreateDate  string
	Attachments []*model.Attachment
}

func SaveMessage

func SaveMessage(c event.Context, e Message) (model.MessageExt, []ForwardExt, error)

type Message

type Message struct {
	AppID        int          `json:"app_id,omitempty"`
	LocalID      string       `json:"local_id,omitempty"`
	IsSilent     bool         `json:"is_silent,omitempty"`
	ReplyLocalID string       `json:"reply_local_id,omitempty"`
	Username     string       `json:"username,omitempty"`
	Text         string       `json:"text,omitempty"`
	Forwards     []Forward    `json:"forwards,omitempty"`
	Attachments  []Attachment `json:"attachments,omitempty"`
}

Jump to

Keyboard shortcuts

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