Documentation ¶
Index ¶
- func AddCallbackHandler(data string, handlerFun func(*objs.Update))
- func AddHandler(patern string, handlerFunc func(*objs.Update), chatType ...string) error
- func ParseSingleUpdate(up *objs.Update, uc *chan *objs.Update, cu *chan *objs.ChatUpdate, ...)
- func ParseUpdate(body []byte, uc *chan *objs.Update, cu *chan *objs.ChatUpdate, ...) (int, error)
- type HandlerTree
- type TreeNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCallbackHandler ¶
func AddHandler ¶
func ParseSingleUpdate ¶
func ParseSingleUpdate(up *objs.Update, uc *chan *objs.Update, cu *chan *objs.ChatUpdate, cfg *configs.BotConfigs)
ParseSingleUpdate processes the given update object.
func ParseUpdate ¶
func ParseUpdate(body []byte, uc *chan *objs.Update, cu *chan *objs.ChatUpdate, cfg *configs.BotConfigs) (int, error)
ParseUpdate parses the received update and returns the last update offset.
Types ¶
type HandlerTree ¶
type HandlerTree struct {
// contains filtered or unexported fields
}
HandlerTree is a special binary tree for storing handlers. Right node hase a value that does not match the it's father regex and the left node matches it's father regex.
func (*HandlerTree) AddHandler ¶
func (tr *HandlerTree) AddHandler(hdl *handler)
AddHandler adds a new handler to the tree.
func (*HandlerTree) GetHandler ¶
func (tr *HandlerTree) GetHandler(msg *objs.Message) *handler
GetHandler gets the proper handler for the given text.
Click to show internal directories.
Click to hide internal directories.