Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Commit 122d253

Browse files
committed
feat: version command
1 parent 4f135c0 commit 122d253

File tree

6 files changed

+29
-4
lines changed

6 files changed

+29
-4
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
66

7-
## Env-File
7+
## Config / Secrets environment variables
8+
9+
Copy `.env.example` to `.env` and add your private information
10+
11+
*Note: never commit this file, it should be ignored by git*
812

913
```
1014
DISCORD_TOKEN=

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@
7777
"coverageDirectory": "../coverage",
7878
"testEnvironment": "node"
7979
}
80-
}
80+
}

src/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { DiscordModule } from 'discord-nestjs';
44
import { AppService } from './app.service';
55
import { DiscordConfigService } from './environment/discord-config.service';
66
import { AlexModule } from './alexjs/alex.module';
7+
import { VersionModule } from './version/version.module';
78

89
@Module({
910
imports: [
@@ -12,6 +13,7 @@ import { AlexModule } from './alexjs/alex.module';
1213
ConfigModule.forRoot({
1314
isGlobal: true,
1415
}),
16+
VersionModule,
1517
],
1618
providers: [AppService, DiscordConfigService],
1719
})

src/version/version.handler.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Injectable } from '@nestjs/common';
2+
import { Context, OnCommand } from 'discord-nestjs';
3+
import { Message } from 'discord.js';
4+
5+
@Injectable()
6+
export class VersionHandler {
7+
@OnCommand({ name: 'version' })
8+
async version(@Context() [context]: [Message]): Promise<void> {
9+
await context.reply(`Currently running version "${process.env.VERSION}"`);
10+
}
11+
}

src/version/version.module.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Module } from '@nestjs/common';
2+
import { VersionHandler } from './version.handler';
3+
4+
@Module({
5+
providers: [VersionHandler],
6+
exports: [],
7+
})
8+
export class VersionModule {}

0 commit comments

Comments
 (0)