messages

package
v0.0.0-...-c98022d Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const PurposePublish = "msg_pub"
View Source
const ReqMsgPub = "msg_pub"

Variables

This section is empty.

Functions

func PublishBasicReplyHandlerFunc

func PublishBasicReplyHandlerFunc(
	clientAwk api.Client,
	groupId string,
	cfg config.Config,
) service.ArgHandlerFunc

func PublishBasicRequest

func PublishBasicRequest(tgCtx telebot.Context) (err error)

Types

type ChanFilter

type ChanFilter struct {
	Pattern string
}

type ChanPostHandler

type ChanPostHandler struct {
	ClientAwk api.Client
	GroupId   string
	Log       *slog.Logger
	Writers   map[string]model.Writer[*pb.CloudEvent]
	Channels  map[string]time.Time
	ChansLock *sync.Mutex
	CfgMsgs   config.MessagesConfig
}

func (ChanPostHandler) Close

func (cp ChanPostHandler) Close()

func (ChanPostHandler) List

func (cp ChanPostHandler) List(ctx context.Context, filter ChanFilter, limit uint32, cursor string, order Order) (page []Channel, err error)

func (ChanPostHandler) Publish

func (cp ChanPostHandler) Publish(tgCtx telebot.Context, chanUserName string) (err error)

type Channel

type Channel struct {
	LastUpdate time.Time
	Link       string
}

type FileType

type FileType int32
const (
	FileTypeUndefined FileType = iota
	FileTypeAudio
	FileTypeDocument
	FileTypeImage
	FileTypeVideo
)

type Format

type Format struct {
	HtmlPolicy       *bluemonday.Policy
	UriReaderEvtBase string
}

func (Format) Convert

func (f Format) Convert(evt *pb.CloudEvent, subId, subDescr string, mode FormatMode) (tgMsg any)

type FormatMode

type FormatMode int
const (
	FormatModeHtml  FormatMode = iota
	FormatModePlain            // no html markup, but keep the telegram attachments
	FormatModeRaw              // no html and no attachments
)

type Order

type Order int
const (
	OrderAsc Order = iota
	OrderDesc
)

func (Order) String

func (o Order) String() string

Jump to

Keyboard shortcuts

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