necord 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,9 @@
1
1
  import { ModuleMetadata, Type } from '@nestjs/common';
2
- import { ClientOptions as DiscordClientOptions } from 'discord.js';
2
+ import { ClientOptions as DiscordClientOptions, Snowflake } from 'discord.js';
3
3
  export interface NecordModuleOptions extends DiscordClientOptions {
4
4
  token: string;
5
5
  prefix?: string | Function;
6
+ development?: Snowflake[];
6
7
  }
7
8
  export interface NecordOptionsFactory {
8
9
  createNecordOptions(): Promise<NecordModuleOptions> | NecordModuleOptions;
@@ -1,8 +1,10 @@
1
1
  import { NecordRegistry } from './necord-registry';
2
+ import { NecordModuleOptions } from './interfaces';
2
3
  export declare class NecordInteractionUpdate {
3
4
  private readonly registry;
5
+ private readonly options;
4
6
  private readonly logger;
5
- constructor(registry: NecordRegistry);
7
+ constructor(registry: NecordRegistry, options: NecordModuleOptions);
6
8
  private onReady;
7
9
  private onInteractionCreate;
8
10
  private transformOptions;
@@ -30,8 +30,9 @@ const necord_constants_1 = require("./necord.constants");
30
30
  const core_1 = require("@nestjs/core");
31
31
  const constants_1 = require("@nestjs/core/injector/constants");
32
32
  let NecordInteractionUpdate = NecordInteractionUpdate_1 = class NecordInteractionUpdate {
33
- constructor(registry) {
33
+ constructor(registry, options) {
34
34
  this.registry = registry;
35
+ this.options = options;
35
36
  this.logger = new common_1.Logger(NecordInteractionUpdate_1.name);
36
37
  }
37
38
  onReady([client]) {
@@ -42,7 +43,7 @@ let NecordInteractionUpdate = NecordInteractionUpdate_1 = class NecordInteractio
42
43
  }
43
44
  const commands = new Map([[undefined, []]]);
44
45
  for (const command of this.registry.getApplicationCommands()) {
45
- const guilds = (_a = command.metadata[necord_constants_1.GUILDS_METADATA]) !== null && _a !== void 0 ? _a : [undefined];
46
+ const guilds = (_a = command.metadata[necord_constants_1.GUILDS_METADATA]) !== null && _a !== void 0 ? _a : [].concat(this.options.development);
46
47
  for (const guild of guilds) {
47
48
  const cmds = (_b = commands.get(guild)) !== null && _b !== void 0 ? _b : [];
48
49
  commands.set(guild, cmds.concat(command));
@@ -118,6 +119,7 @@ __decorate([
118
119
  ], NecordInteractionUpdate.prototype, "onInteractionCreate", null);
119
120
  NecordInteractionUpdate = NecordInteractionUpdate_1 = __decorate([
120
121
  (0, common_1.Injectable)(),
121
- __metadata("design:paramtypes", [necord_registry_1.NecordRegistry])
122
+ __param(1, (0, common_1.Inject)(necord_constants_1.NECORD_MODULE_OPTIONS)),
123
+ __metadata("design:paramtypes", [necord_registry_1.NecordRegistry, Object])
122
124
  ], NecordInteractionUpdate);
123
125
  exports.NecordInteractionUpdate = NecordInteractionUpdate;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "necord",
3
3
  "description": "A module for creating Discord bots using NestJS, based on Discord.js.",
4
- "version": "4.0.0",
4
+ "version": "4.1.0",
5
5
  "scripts": {
6
6
  "build": "rimraf -rf dist && tsc -p tsconfig.json",
7
7
  "prepublish:npm": "npm run build",
@@ -45,26 +45,26 @@
45
45
  ],
46
46
  "dependencies": {},
47
47
  "devDependencies": {
48
- "@commitlint/cli": "16.0.2",
48
+ "@commitlint/cli": "16.1.0",
49
49
  "@commitlint/config-angular": "16.0.0",
50
50
  "@favware/npm-deprecate": "1.0.4",
51
- "@nestjs/common": "8.2.4",
52
- "@nestjs/core": "8.2.4",
53
- "@types/node": "17.0.8",
51
+ "@nestjs/common": "8.2.6",
52
+ "@nestjs/core": "8.2.6",
53
+ "@types/node": "17.0.10",
54
54
  "@typescript-eslint/eslint-plugin": "4.33.0",
55
55
  "@typescript-eslint/parser": "4.33.0",
56
- "discord.js": "13.5.1",
56
+ "discord.js": "13.6.0",
57
57
  "eslint": "7.32.0",
58
58
  "eslint-config-prettier": "8.3.0",
59
59
  "eslint-plugin-prettier": "4.0.0",
60
60
  "husky": "7.0.4",
61
61
  "prettier": "2.5.1",
62
62
  "reflect-metadata": "0.1.13",
63
- "release-it": "14.12.1",
63
+ "release-it": "14.12.3",
64
64
  "rimraf": "3.0.2",
65
- "rxjs": "7.5.1",
65
+ "rxjs": "7.5.2",
66
66
  "ts-node": "^10.4.0",
67
- "typescript": "4.5.4"
67
+ "typescript": "4.5.5"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@nestjs/common": "^8.0.0",