messages

package
v0.0.0-...-9b69469 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EndConversation = errors.New("end")
)

Functions

func MonitorMessages

func MonitorMessages(ctx context.Context, client *telegram.Client, dispatcher tg.UpdateDispatcher, work func(chatID int64, m *tg.Message) error, done chan bool)

MonitorMessages accepts a function to process the message along with the chatID of the channel from which it was received. This function is deprecated please use the `Monitoring` class for simplicity.

Types

type Monitoring

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

func NewMonitoring

func NewMonitoring(dispatcher tg.UpdateDispatcher, id int64, strip bool) *Monitoring

func (*Monitoring) Handle

func (m *Monitoring) Handle(re *regexp.Regexp, handler func(ctx MonitoringContext) error)

func (*Monitoring) Listen

func (m *Monitoring) Listen(ctx context.Context, client *telegram.Client) error

func (*Monitoring) SetupMessageMonitoring

func (a *Monitoring) SetupMessageMonitoring(messagesChan chan *tg.Message)

type MonitoringContext

type MonitoringContext struct {
	Ctx context.Context
	// contains filtered or unexported fields
}

func (*MonitoringContext) GetClient

func (m *MonitoringContext) GetClient() *telegram.Client

func (*MonitoringContext) GetMessage

func (m *MonitoringContext) GetMessage() *tg.Message

type RouteEntry

type RouteEntry struct {
	Regex   *regexp.Regexp
	Handler func(ctx MonitoringContext) error
}

Jump to

Keyboard shortcuts

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