receiver

package
v0.10.11 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReplyMarkup added in v0.10.9

func ReplyMarkup(ctx context.Context, replyMarkup telegram.ReplyMarkup) context.Context

func SkipOnMediaError added in v0.10.9

func SkipOnMediaError(ctx context.Context) context.Context

Types

type Broadcast

type Broadcast struct {
	Receivers []Interface
	Strict    bool
}

func (*Broadcast) SendMedia

func (r *Broadcast) SendMedia(ctx context.Context, ref MediaRef, caption string) error

func (*Broadcast) SendText

func (r *Broadcast) SendText(ctx context.Context, text string) error

type Buffer

type Buffer struct {
	Pages []string
	Media []MediaCaption
}

func NewBuffer

func NewBuffer() *Buffer

func (*Buffer) Flush

func (b *Buffer) Flush(ctx context.Context, receiver Interface) error

func (*Buffer) SendMedia

func (b *Buffer) SendMedia(ctx context.Context, ref MediaRef, caption string) error

func (*Buffer) SendText

func (b *Buffer) SendText(ctx context.Context, text string) error

type Chat

type Chat struct {
	Sender    telegram.Sender
	ID        telegram.ChatID
	Silent    bool
	Preview   bool
	ParseMode telegram.ParseMode
}

func (*Chat) SendMedia

func (r *Chat) SendMedia(ctx context.Context, ref MediaRef, caption string) error

func (*Chat) SendText

func (r *Chat) SendText(ctx context.Context, text string) error

func (*Chat) String

func (r *Chat) String() string

type Interface

type Interface interface {
	SendText(ctx context.Context, text string) error
	SendMedia(ctx context.Context, ref MediaRef, caption string) error
}

type Media added in v0.10.5

type Media struct {
	MIMEType string
	Input    flu.Input
}

type MediaCaption added in v0.10.9

type MediaCaption struct {
	Ref     MediaRef
	Caption string
}

type MediaError added in v0.10.9

type MediaError struct {
	E error
}

func (MediaError) Cause added in v0.10.9

func (e MediaError) Cause() error

func (MediaError) Error added in v0.10.9

func (e MediaError) Error() string

func (MediaError) Get added in v0.10.9

func (e MediaError) Get(ctx context.Context) (media *Media, err error)

func (MediaError) Unwrap added in v0.10.9

func (e MediaError) Unwrap() error

type MediaFunc added in v0.10.9

type MediaFunc func(ctx context.Context) (*Media, error)

func (MediaFunc) Media added in v0.10.9

func (f MediaFunc) Media(ctx context.Context) (*Media, error)

type MediaRef added in v0.10.9

type MediaRef = syncf.Ref[*Media]

Jump to

Keyboard shortcuts

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