diff --git a/docs/content/recipes/stat-reporter.md b/docs/content/recipes/stat-reporter.md index 1a08be7..cf64623 100644 --- a/docs/content/recipes/stat-reporter.md +++ b/docs/content/recipes/stat-reporter.md @@ -13,10 +13,9 @@ Is a lightweight stat reporter module for NestCord. This module sends data from Once the installation process is complete, we can import the `NestCordStatReporterModule` with your `NestCordModule` into the root `AppModule`: ```typescript -import { NestCordModule, NestCordStatReporterModule } from '@globalart/nestcord'; +import { NestCordModule, NestCordStatReporterModule, StatCronExpression } from '@globalart/nestcord'; import { Module } from '@nestjs/common'; import { NestCordLocalizationModule, DefaultLocalizationAdapter, UserResolver } from '@globalart/nestcord'; -import { CronExpression } from '@nestjs/schedule'; import { AppService } from './app.service'; @Module({ @@ -40,7 +39,7 @@ import { AppService } from './app.service'; url: 'https://top.gg/bots/:bot_id/stats', bodyData: { server_count: '{{serverCount}}', shard_count: '{{shardCount}}' }, headerData: { Authorization: process.env.TOP_GG_TOKEN }, - schedule: CronExpression.EVERY_5_MINUTES, + schedule: StatCronExpression.EVERY_5_MINUTES // or you can use cronab expression like */1 * * * * , }, ], }), diff --git a/examples/stat-reporter/src/app.module.ts b/examples/stat-reporter/src/app.module.ts index b891c71..7d90cba 100644 --- a/examples/stat-reporter/src/app.module.ts +++ b/examples/stat-reporter/src/app.module.ts @@ -2,8 +2,7 @@ import { GatewayIntentBits, Partials } from 'discord.js'; import { NestCordModule } from '../../../packages/core'; import { Module } from '@nestjs/common'; import { AppGateway } from './app.gateway'; -import { NestCordStatReporterModule } from '../../../packages/stat-reporter'; -import { CronExpression } from '@nestjs/schedule'; +import { NestCordStatReporterModule, StatCronExpression } from '../../../packages'; @Module({ imports: [ @@ -28,7 +27,7 @@ import { CronExpression } from '@nestjs/schedule'; headerData: { Authorization: process.env.TOP_GG_TOKEN, }, - schedule: CronExpression.EVERY_30_SECONDS, + schedule: StatCronExpression.EVERY_MINUTE, }, ], log: true,