receiver

package
v0.9.35 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedMediaType = errors.New("unsupported media type")

Functions

This section is empty.

Types

type Broadcast

type Broadcast struct {
	Receivers []Interface
	Strict    bool
}

func (*Broadcast) SendMedia

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

func (*Broadcast) SendText

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

type Buffer

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

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 media.Ref, caption string) error

func (*Buffer) SendText

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

type CaptionedMedia

type CaptionedMedia struct {
	Ref     media.Ref
	Caption string
}

type Chat

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

func (*Chat) SendMedia

func (r *Chat) SendMedia(ctx context.Context, ref media.Ref, 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 media.Ref, caption string) error
}

Jump to

Keyboard shortcuts

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