chatbot

package
v0.0.0-...-04bcfef Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatBot

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

func NewChatBot

func NewChatBot() *ChatBot

func (*ChatBot) Conversation

func (cb *ChatBot) Conversation(m *tb.Message) (Conversation, bool)

func (*ChatBot) HasConversation

func (cb *ChatBot) HasConversation(m *tb.Message) bool

func (*ChatBot) ProcessMessage

func (cb *ChatBot) ProcessMessage(m *tb.Message)

func (*ChatBot) RegisterCommand

func (cb *ChatBot) RegisterCommand(cmd string, h Handler)

func (*ChatBot) RegisterConvoCommand

func (cb *ChatBot) RegisterConvoCommand(cmd string, h ConvoHandler)

func (*ChatBot) RegisterFallback

func (cb *ChatBot) RegisterFallback(h Handler)

func (*ChatBot) Route

func (cb *ChatBot) Route(m *tb.Message)

func (*ChatBot) StartConversation

func (cb *ChatBot) StartConversation(c Conversation, m *tb.Message)

func (*ChatBot) StopConversation

func (cb *ChatBot) StopConversation(c Conversation)

type Conversation

type Conversation interface {
	Run(m *tb.Message)
	CurrentStep() Handler
	Name() string
}

type ConvoHandler

type ConvoHandler func(Conversation, *tb.Message)

type Handler

type Handler func(*tb.Message)

Jump to

Keyboard shortcuts

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