messages

package
v0.0.0-...-c452e5e Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: AGPL-3.0 Imports: 29 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,
	svcMsgs messages.Service,
	cfgPayment config.PaymentConfig,
) service.ArgHandlerFunc

func PublishBasicRequest

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

func PublishPaid

func PublishPaid(
	svcMsgs messages.Service,
	clientAwk api.Client,
	groupId string,
	log *slog.Logger,
	cfgBackoff config.BackoffConfig,
) service.ArgHandlerFunc

func PublishPreCheckout

func PublishPreCheckout(svcMsgs messages.Service, cfgPayment config.PaymentConfig) service.ArgHandlerFunc

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
}

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) (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
}

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