From bf78cd75d3123f8d86da66638f4a2a9c327f8123 Mon Sep 17 00:00:00 2001 From: Kirillkriv Date: Tue, 6 Oct 2026 14:04:33 +0300 Subject: [PATCH] fix: dispatcher can now accept handlers --- v1/core/dispatcher.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/v1/core/dispatcher.go b/v1/core/dispatcher.go index 970a993..34401c9 100644 --- a/v1/core/dispatcher.go +++ b/v1/core/dispatcher.go @@ -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) }