monitor

package
v0.0.0-...-47bbb21 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MsgReqDelay = 30 * time.Second
View Source
const RecoveringDelay = 5 * time.Minute

Variables

This section is empty.

Functions

This section is empty.

Types

type Chats

type Chats struct {
	Sources      []tg.InputPeerChannel
	Destinations []tg.InputPeerClass
}

type Monitor

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

func New

func New(options Options, db *sql.DB, bot *bot.Bot, parentLogger *zap.SugaredLogger) *Monitor

func (Monitor) RecoverSync

func (m Monitor) RecoverSync() error

func (Monitor) ReplyMessageRating

func (m Monitor) ReplyMessageRating(
	e tg.Entities,
	u *tg.UpdateNewChannelMessage,
	replyID int,
	chat *tg.Channel,
) error

func (Monitor) UpdateMessage

func (m Monitor) UpdateMessage(chat tg.InputChannel, msg db.Message) (db.Message, error)

func (Monitor) WatchSync

func (m Monitor) WatchSync(ctx context.Context, delay time.Duration, ageLimit time.Duration)

WatchSync runs reactions & replies monitor delay - duration between each check ageLimit - duration in which messages will be monitored

type Options

type Options struct {
	Thresholds       Thresholds
	Chats            Chats
	NoQuoteWhitelist []int64
}

type Thresholds

type Thresholds struct {
	Text    int
	Photo   int
	Forward int
}

Jump to

Keyboard shortcuts

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