plugin

package
v0.0.0-...-eb4b608 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackHandler

type CallbackHandler struct {
	HandlerFunc  GobotHandlerFunc
	Trigger      *regexp.Regexp
	AdminOnly    bool
	DeleteButton bool
	Cooldown     time.Duration
}

func (*CallbackHandler) Command

func (h *CallbackHandler) Command() any

func (*CallbackHandler) Run

type CommandHandler

type CommandHandler struct {
	Trigger     any
	HandlerFunc GobotHandlerFunc
	AdminOnly   bool
	GroupOnly   bool
	HandleEdits bool
}

func (*CommandHandler) Command

func (h *CommandHandler) Command() any

func (*CommandHandler) Run

func (h *CommandHandler) Run(c GobotContext) error

type GobotContext

type GobotContext struct {
	telebot.Context
	Matches      []string          // Regex matches
	NamedMatches map[string]string // Named Regex matches
}

type GobotHandlerFunc

type GobotHandlerFunc func(c GobotContext) error

type Handler

type Handler interface {
	Command() any
	Run(c GobotContext) error
}

type InlineHandler

type InlineHandler struct {
	HandlerFunc         GobotHandlerFunc
	Trigger             *regexp.Regexp
	AdminOnly           bool
	CanBeUsedByEveryone bool
}

func (*InlineHandler) Command

func (h *InlineHandler) Command() any

func (*InlineHandler) Run

func (h *InlineHandler) Run(c GobotContext) error

type Plugin

type Plugin interface {
	Name() string

	// Commands will be shown in the menu button
	Commands() []telebot.Command

	// Handlers are used to react to specific strings & entities in a message
	Handlers(botInfo *telebot.User) []Handler
}

Jump to

Keyboard shortcuts

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