From 1b65b31ed2866fa96d5da714c18985e2e129d8eb Mon Sep 17 00:00:00 2001 From: evermake Date: Sun, 31 Mar 2024 12:14:48 +0300 Subject: [PATCH] chore: remove `parse-mode` plugin --- backend/package.json | 1 - backend/src/bot/index.ts | 1 - backend/src/bot/plugins/index.ts | 2 -- backend/src/bot/plugins/parse-mode.ts | 14 -------------- pnpm-lock.yaml | 12 ------------ 5 files changed, 30 deletions(-) delete mode 100644 backend/src/bot/plugins/parse-mode.ts diff --git a/backend/package.json b/backend/package.json index adb11fe..7810b9c 100644 --- a/backend/package.json +++ b/backend/package.json @@ -13,7 +13,6 @@ }, "dependencies": { "@grammyjs/auto-retry": "^1.1.1", - "@grammyjs/parse-mode": "^1.9.0", "@grammyjs/runner": "^2.0.3", "@prisma/client": "5.11.0", "@telegum/grammy-buttons": "^0.1.3", diff --git a/backend/src/bot/index.ts b/backend/src/bot/index.ts index 42d0726..c022da5 100644 --- a/backend/src/bot/index.ts +++ b/backend/src/bot/index.ts @@ -18,7 +18,6 @@ export function createBot({ plugins.logging.install(bot, { logger }) plugins.floodControl.install(bot) - plugins.parseMode.install(bot, { parseMode: 'HTML' }) plugins.messageSending.install(bot) plugins.domain.install(bot, { domain }) plugins.translations.install(bot) diff --git a/backend/src/bot/plugins/index.ts b/backend/src/bot/plugins/index.ts index b8d8145..9f69932 100644 --- a/backend/src/bot/plugins/index.ts +++ b/backend/src/bot/plugins/index.ts @@ -1,7 +1,6 @@ import type { Bot, Context } from 'grammy' import * as logging from './logging' import * as floodControl from './flood-control' -import * as parseMode from './parse-mode' import * as messageSending from './message-sending' import * as domain from './domain' import * as translations from './translations' @@ -15,7 +14,6 @@ export type InstallFn = export default { logging, floodControl, - parseMode, messageSending, domain, translations, diff --git a/backend/src/bot/plugins/parse-mode.ts b/backend/src/bot/plugins/parse-mode.ts deleted file mode 100644 index 5a7865d..0000000 --- a/backend/src/bot/plugins/parse-mode.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { parseMode } from '@grammyjs/parse-mode' -import type { InstallFn } from '.' - -export type ParseModeOptions = { - parseMode: 'MarkdownV2' | 'HTML' -} - -// eslint-disable-next-line ts/ban-types -export const install: InstallFn<{}, ParseModeOptions> = ( - bot, - { parseMode: parseModeName }, -) => { - bot.api.config.use(parseMode(parseModeName)) -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 573174a..c2ab81e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -47,9 +47,6 @@ importers: '@grammyjs/auto-retry': specifier: ^1.1.1 version: 1.1.1 - '@grammyjs/parse-mode': - specifier: ^1.9.0 - version: 1.9.0(grammy@1.21.1) '@grammyjs/runner': specifier: ^2.0.3 version: 2.0.3(grammy@1.21.1) @@ -573,15 +570,6 @@ packages: engines: {node: '>=12.20.0 || >=14.13.1'} dev: false - /@grammyjs/parse-mode@1.9.0(grammy@1.21.1): - resolution: {integrity: sha512-c5luhtGQVkby+EJ+P/RLuEJH4+PTuw6Mm1feLM2MjoBIzGVGnPigMKvrgzndnJ6ixsyJtUlhMxuuiWreZRT8Qg==} - engines: {node: '>=14.13.1'} - peerDependencies: - grammy: ^1.20.1 - dependencies: - grammy: 1.21.1 - dev: false - /@grammyjs/runner@2.0.3(grammy@1.21.1): resolution: {integrity: sha512-nckmTs1dPWfVQteK9cxqxzE+0m1VRvluLWB8UgFzsjg62w3qthPJt0TYtJBEdG7OedvfQq4vnFAyE6iaMkR42A==} engines: {node: '>=12.20.0 || >=14.13.1'}