filters

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter[T Filterable](callable func(*gobotapi.Client, T), operands FilterOperand) func(*gobotapi.Client, T)

Types

type DataFilter added in v1.4.0

type DataFilter struct {
	Chat      *types.Chat
	Date      *int64
	From      *types.User
	Message   *types.Message
	Client    *gobotapi.Client
	RawUpdate any
}

type FilterOperand

type FilterOperand func(options *DataFilter) bool

func And

func And(options ...FilterOperand) FilterOperand

func AntiFlood added in v1.4.0

func AntiFlood(numEvents int, inTime time.Duration, banTime time.Duration) FilterOperand

func ChatID

func ChatID(idList ...int64) FilterOperand

func Command added in v1.4.1

func Command(command string, aliasList ...string) FilterOperand

func Commands added in v1.4.1

func Commands(command []string, aliasList ...string) FilterOperand

func Group added in v1.2.2

func Group() FilterOperand

func Not added in v1.1.8

func Not(option FilterOperand) FilterOperand

func Or

func Or(options ...FilterOperand) FilterOperand

func Private added in v1.2.2

func Private() FilterOperand

func SuperGroup added in v1.2.2

func SuperGroup() FilterOperand

func UserID

func UserID(idList ...int64) FilterOperand

Jump to

Keyboard shortcuts

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