diff --git a/apps/bot/src/bot/index.ts b/apps/bot/src/bot/index.ts index a947a6e..06f1b7e 100644 --- a/apps/bot/src/bot/index.ts +++ b/apps/bot/src/bot/index.ts @@ -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(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, }), );