24 lines
418 B
Go
24 lines
418 B
Go
package handler
|
|
|
|
import (
|
|
"github.com/mymmrac/telego"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
type NoopHandler struct {
|
|
logger *zap.SugaredLogger
|
|
debug bool
|
|
}
|
|
|
|
func NewNoopHandler(logger *zap.SugaredLogger, debug bool) *NoopHandler {
|
|
return &NoopHandler{logger: logger, debug: debug}
|
|
}
|
|
|
|
func (h *NoopHandler) Handle(update telego.Update) error {
|
|
if h.debug {
|
|
h.logger.Debugf("unsupported update: %+v", update)
|
|
}
|
|
|
|
return nil
|
|
}
|