errorhandler

package
v1.6.1-0...-105477e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ErrorSendDelay = time.Second * 5

ErrorSendDelay is the delay between sending errors to Telegram

Variables

This section is empty.

Functions

func HandleError

func HandleError(b *gotgbot.Bot, ctx *ext.Context, err error) ext.DispatcherAction

func PanicsHandler

func PanicsHandler(b *gotgbot.Bot, ctx *ext.Context, r interface{})

PanicsHandler handles panics in the code and sends them to the user.

Implements the ext.DispatcherPanicHandler interface.

func SendErrorPageToChat

func SendErrorPageToChat(ctx2 *ext.Context, bot *gotgbot.Bot, lang i18n.Language)

func SendErrorToTelegram

func SendErrorToTelegram(err error, bot *gotgbot.Bot)

func SendPageToChat

func SendPageToChat(ctx2 *ext.Context, bot *gotgbot.Bot, page *pages.Page)

SendPageToChat sends the given page to the chat of the given update. It either edits the message or sends a new one.

func Setup

func Setup(langs2 map[string]i18n.Language, chatRepo2 data.ChatRepository)

Setup sets up error handler

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL