Revert "refactor(bot): remove Redis integration from bot configuration"

This reverts commit 4fbbccb0a2967af0c92ff19fe337467347d9a91a.
This commit is contained in:
vchikalkin 2025-08-26 22:17:54 +03:00
parent 4fbbccb0a2
commit 38392ea3ad

View File

@ -8,6 +8,7 @@ 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';
@ -18,6 +19,8 @@ type Parameters_ = {
token: string;
};
const redis = getRedisInstance();
export function createBot({ token }: Parameters_) {
const bot = new Bot<Context>(token);
@ -30,6 +33,7 @@ export function createBot({ token }: Parameters_) {
onLimitExceeded: async (ctx) => {
await ctx.reply(ctx.t('err-limit-exceeded'));
},
storageClient: redis,
timeFrame: env.RATE_LIMIT_TIME,
}),
);