refactor(bot): remove Redis integration from bot configuration

- Eliminated Redis instance and related storage client from the bot's configuration, streamlining the setup and reducing dependencies.
- Updated bot middleware to enhance performance and maintainability.
This commit is contained in:
vchikalkin 2025-08-26 22:12:06 +03:00
parent 0f2b1f5353
commit 4fbbccb0a2

View File

@ -8,7 +8,6 @@ import { setCommands } from './settings/commands';
import { setInfo } from './settings/info';
import { env } from '@/config/env';
import { logger } from '@/utils/logger';
import { getRedisInstance } from '@/utils/redis';
import { autoChatAction } from '@grammyjs/auto-chat-action';
import { conversations } from '@grammyjs/conversations';
import { hydrate } from '@grammyjs/hydrate';
@ -19,8 +18,6 @@ type Parameters_ = {
token: string;
};
const redis = getRedisInstance();
export function createBot({ token }: Parameters_) {
const bot = new Bot<Context>(token);
@ -33,7 +30,6 @@ export function createBot({ token }: Parameters_) {
onLimitExceeded: async (ctx) => {
await ctx.reply(ctx.t('err-limit-exceeded'));
},
storageClient: redis,
timeFrame: env.RATE_LIMIT_TIME,
}),
);