handlers

package
v0.0.0-...-5db6154 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTriggers = []rune{'.'}

Functions

This section is empty.

Types

type Command

type Command struct {
	Prefix   []rune
	Command  string
	Logger   *logger.Logger
	Response Response
	// contains filtered or unexported fields
}

func NewCommand

func NewCommand(command string, callback Response, logger *logger.Logger) *Command

func NewCommandWithPrefix

func NewCommandWithPrefix(prefix []rune, command string, callback Response, logger *logger.Logger) *Command

func (*Command) AddDescription

func (m *Command) AddDescription(desc string) Handler

func (Command) CheckUpdate

func (m Command) CheckUpdate(ctx *context.Context) bool

func (Command) GetDescription

func (m Command) GetDescription() string

func (Command) GetName

func (m Command) GetName() string

func (Command) HandleUpdate

func (m Command) HandleUpdate(client *whatsmeow.Client, ctx *context.Context) error

type Handler

type Handler interface {
	CheckUpdate(ctx *context.Context) bool
	HandleUpdate(client *whatsmeow.Client, ctx *context.Context) error
	AddDescription(desc string) Handler
	GetDescription() string
	GetName() string
}

type Message

type Message struct {
	Logger   *logger.Logger
	Response Response
	// contains filtered or unexported fields
}

func NewMessage

func NewMessage(callback Response, logger *logger.Logger) *Message

func (*Message) AddDescription

func (m *Message) AddDescription(desc string) Handler

func (Message) CheckUpdate

func (m Message) CheckUpdate(ctx *context.Context) bool

func (Message) GetDescription

func (m Message) GetDescription() string

func (Message) GetName

func (m Message) GetName() string

func (Message) HandleUpdate

func (m Message) HandleUpdate(client *whatsmeow.Client, ctx *context.Context) error

type Response

type Response func(client *whatsmeow.Client, ctx *context.Context) error

Jump to

Keyboard shortcuts

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