Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RozmarinUS committed May 29, 2024
1 parent 82d5876 commit c55c0ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions docs/content/recipes/stat-reporter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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 * * * * ,
},
],
}),
Expand Down
5 changes: 2 additions & 3 deletions examples/stat-reporter/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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,
Expand Down

0 comments on commit c55c0ad

Please sign in to comment.