Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/grammy/mod.ts>Bot#catch

The Telegram Bot Framework.
Very Popular
Latest
method Bot.prototype.catch
Re-export
import { Bot } from "https://deno.land/x/grammy@v1.30.1/mod.ts";

Sets the bots error handler that is used during long polling.

You should call this method to set an error handler if you are using long polling, no matter whether you use bot.start or the @grammyjs/runner package to run your bot.

Calling bot.catch when using other means of running your bot (or webhooks) has no effect.

Parameters

errorHandler: ErrorHandler<C>

A function that handles potential middleware errors