telegrambot

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FSMEventDefault            = "run"
	FSMEventReset              = "reset"
	FSMMetadataNextEvent       = "next_event"
	FSMMetadataMessage         = "msg"
	FSMMetadataErrRecoverEvent = "err_recover_event"
	FSMMetadataTelegoUpdate    = "telego_update"
)
View Source
const (
	CallbackCommandSeparator = "|"
)

Variables

This section is empty.

Functions

func GetCommandFromCallbackData

func GetCommandFromCallbackData(callbackQuery *telego.CallbackQuery) string

func GetDataFromCallbackData

func GetDataFromCallbackData(callbackQuery *telego.CallbackQuery) string

func IsPrivateMessage added in v0.0.6

func IsPrivateMessage(update telego.Update) bool

func NewCallbackData

func NewCallbackData(command string, data string) string

Types

type Command

type Command struct {
	StateMachine *fsm.FSM
	NextFSMEvent string
	Handler      CommandHandler
}

func (Command) GetNextFSMEvent added in v0.0.7

func (c Command) GetNextFSMEvent() string

type CommandHandler

type CommandHandler func(update telego.Update, msgResponse *telego.SendMessageParams)

type Commands

type Commands map[string]Command

type FilterFunc added in v0.0.6

type FilterFunc func(update telego.Update) bool

type NukiBot added in v0.0.4

type NukiBot interface {
	Start() error
	AddFilter(FilterFunc)
}

func NewNukiBot added in v0.0.4

func NewNukiBot(sender *messaging.TelegramSender,
	logsReader nukiapi.LogsReader,
	smartlockReader nukiapi.SmartlockReader,
	reservationsReader nukiapi.ReservationsReader,
	smartlockAuthReader nukiapi.SmartlockAuthReader,
	defaultCheckIn time.Time,
	defaultCheckOut time.Time,
	filters ...FilterFunc) (NukiBot, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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