Initial commit

This commit is contained in:
2023-09-08 22:09:35 +03:00
commit 2a6488488e
20 changed files with 2581 additions and 0 deletions

12
src/helpers/error.ts Normal file
View File

@ -0,0 +1,12 @@
import { ErrorHandler } from "grammy";
import type { Context } from "#root/context.js";
import { getUpdateInfo } from "./logging.js";
export const errorHandler: ErrorHandler<Context> = (error) => {
const { ctx } = error;
ctx.logger.error({
err: error.error,
update: getUpdateInfo(ctx),
});
};