message

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	// contains filtered or unexported fields
}

func (*Entity) CreateMessage

func (e *Entity) CreateMessage(ctx context.Context, id, channelID, userID int64, content string, attachments []int64, embedsJSON, autoEmbedsJSON string) error

func (*Entity) CreateSystemMessage added in v1.5.0

func (e *Entity) CreateSystemMessage(ctx context.Context, id, channelID, userID int64, content string, msgType model.MessageType) error

func (*Entity) DeleteChannelMessages

func (e *Entity) DeleteChannelMessages(ctx context.Context, channelID, lastID int64) error

func (*Entity) DeleteMessage

func (e *Entity) DeleteMessage(ctx context.Context, id, channelID int64) error

func (*Entity) GetChannelMessagesByIDs

func (e *Entity) GetChannelMessagesByIDs(ctx context.Context, channelID int64, ids []int64) ([]model.Message, error)

func (*Entity) GetMessage

func (e *Entity) GetMessage(ctx context.Context, id, channelID int64) (model.Message, error)

func (*Entity) GetMessagesAfter

func (e *Entity) GetMessagesAfter(ctx context.Context, channelID, msgID, lastChannelMessage int64, limit int) ([]model.Message, []int64, error)

func (*Entity) GetMessagesAround added in v1.4.0

func (e *Entity) GetMessagesAround(ctx context.Context, channelID, msgID, lastChannelMessage int64, limit int) ([]model.Message, []int64, error)

func (*Entity) GetMessagesBefore

func (e *Entity) GetMessagesBefore(ctx context.Context, channelID, msgID int64, limit int) ([]model.Message, []int64, error)

func (*Entity) GetMessagesList

func (e *Entity) GetMessagesList(ctx context.Context, msgIDs []int64) ([]model.Message, error)

func (*Entity) UpdateGeneratedEmbeds added in v1.7.0

func (e *Entity) UpdateGeneratedEmbeds(ctx context.Context, id, channelID int64, autoEmbedsJSON string) error

func (*Entity) UpdateMessage

func (e *Entity) UpdateMessage(ctx context.Context, id, channelID int64, content, embedsJSON, autoEmbedsJSON string, flags int) error

type Message

type Message interface {
	CreateMessage(ctx context.Context, id, channelID, userID int64, content string, attachments []int64, embedsJSON, autoEmbedsJSON string) error
	CreateSystemMessage(ctx context.Context, id, channelId, userId int64, content string, msgType model.MessageType) error
	UpdateMessage(ctx context.Context, id, channelID int64, content, embedsJSON, autoEmbedsJSON string, flags int) error
	UpdateGeneratedEmbeds(ctx context.Context, id, channelID int64, autoEmbedsJSON string) error
	DeleteMessage(ctx context.Context, id, channelId int64) error
	DeleteChannelMessages(ctx context.Context, channelID, lastId int64) error
	GetMessage(ctx context.Context, id, channelId int64) (model.Message, error)
	GetMessagesBefore(ctx context.Context, channelId, msgId int64, limit int) ([]model.Message, []int64, error)
	GetMessagesAfter(ctx context.Context, channelId, msgId, lastChannelMessage int64, limit int) ([]model.Message, []int64, error)
	GetMessagesAround(ctx context.Context, channelId, msgId, lastChannelMessage int64, limit int) ([]model.Message, []int64, error)
	GetMessagesList(ctx context.Context, msgIds []int64) ([]model.Message, error)
	GetChannelMessagesByIDs(ctx context.Context, channelId int64, ids []int64) ([]model.Message, error)
}

func New

func New(c *db.CQLCon) Message

Jump to

Keyboard shortcuts

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