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) SetupMessageMonitoring ¶
func (a *Monitoring) SetupMessageMonitoring(messagesChan chan *tg.Message)
type MonitoringContext ¶
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 }
Click to show internal directories.
Click to hide internal directories.