fix: dispatcher can now accept handlers
This commit is contained in:
1 parent
a78e9927bc
commit
bf78cd75d3
1 file changed
+8
@@ -78,6 +78,14 @@ func NewDispatcher(api *maxbot.Api, options ...DispatcherOption) *Dispatcher {
|
||||
return d
|
||||
}
|
||||
|
||||
func (d *Dispatcher) Handle(handler UpdateHandler, filters func(c *mcontext.Context) bool) {
|
||||
d.rt.Handle(handler, filters)
|
||||
}
|
||||
|
||||
func (d *Dispatcher) HandleFunc(handler func(c *mcontext.Context) error, filters ...func(c *mcontext.Context) bool) {
|
||||
d.rt.HandleFunc(handler, filters...)
|
||||
}
|
||||
|
||||
func (d *Dispatcher) HandleUpdate(c *mcontext.Context) error {
|
||||
return d.rt.HandleUpdate(c)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user