Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Context ¶ added in v1.0.2
Context returns the update context installed by WithContext. It panics if the handler is running without that middleware.
func IsClientError ¶ added in v1.0.2
IsClientError reports whether err wraps an error created by NewClientError.
func LogOnErr ¶
LogOnErr returns a Telebot error handler that logs with the update context when available. It uses parent for errors reported outside a handler.
func ReportOnErr ¶
ReportOnErr returns a Telebot error handler that logs the error and replies in the update's chat. Client errors expose their message and other errors receive a generic reply.
func WithContext ¶ added in v1.0.2
func WithContext(parent context.Context) tele.MiddlewareFunc
WithContext derives an update context from parent and adds the update ID to its logger.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error wraps a handler error with an HTTP status code for error reporting.
func NewClientError ¶
NewClientError wraps an error whose message may be shown to the user.
func NewServerError ¶
NewServerError wraps an internal error reported with a generic reply.