fix: dispatcher can now accept handlers

This commit is contained in:
abelith committed 2026-10-06 14:04:33 +03:00
1 parent a78e9927bc
commit bf78cd75d3
1 file changed
+8
+8
View File
@@ -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)
}