necord 1.0.5 → 1.0.8

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.
@@ -8,11 +8,12 @@ const necord_constants_1 = require("../necord.constants");
8
8
  const ContextMenu = (type, name, defaultPermission = true) => (0, common_1.applyDecorators)((0, utils_1.createNecordListener)({
9
9
  event: 'interactionCreate',
10
10
  once: false,
11
- filter: (i) => i.isContextMenu() &&
12
- i.commandName === name &&
13
- i.targetType === (type === 2 /* User */ ? 'USER' : 'MESSAGE')
14
- }), (0, common_1.SetMetadata)(necord_constants_1.APPLICATION_COMMAND_METADATA, new builders_1.ContextMenuCommandBuilder().setName(name).setType(type).setDefaultPermission(defaultPermission)));
15
- const MessageCommand = (name, defaultPermission = true) => ContextMenu(3 /* Message */, name, defaultPermission);
11
+ filter: (i) => i.isContextMenu() && i.commandName === name && i.targetType === type
12
+ }), (0, common_1.SetMetadata)(necord_constants_1.APPLICATION_COMMAND_METADATA, new builders_1.ContextMenuCommandBuilder()
13
+ .setName(name)
14
+ .setType(type)
15
+ .setDefaultPermission(defaultPermission)));
16
+ const MessageCommand = (name, defaultPermission = true) => ContextMenu('MESSAGE', name, defaultPermission);
16
17
  exports.MessageCommand = MessageCommand;
17
- const UserCommand = (name, defaultPermission = true) => ContextMenu(2 /* User */, name, defaultPermission);
18
+ const UserCommand = (name, defaultPermission = true) => ContextMenu('USER', name, defaultPermission);
18
19
  exports.UserCommand = UserCommand;
@@ -71,8 +71,8 @@ let NecordModule = NecordModule_1 = class NecordModule {
71
71
  NecordModule = NecordModule_1 = __decorate([
72
72
  (0, common_1.Module)({
73
73
  imports: [core_1.DiscoveryModule],
74
- providers: [services_1.MetadataAccessorService, services_1.ApplicationCommandsService, necord_client_1.NecordClient, services_1.ExplorerService],
75
- exports: [necord_client_1.NecordClient]
74
+ providers: [services_1.MetadataAccessorService, services_1.ExplorerService, services_1.ApplicationCommandsService, necord_client_1.NecordClient],
75
+ exports: [necord_client_1.NecordClient, services_1.ApplicationCommandsService]
76
76
  })
77
77
  ], NecordModule);
78
78
  exports.NecordModule = NecordModule;
@@ -28,7 +28,7 @@ let MetadataAccessorService = class MetadataAccessorService {
28
28
  }
29
29
  getOptions(target, methodName) {
30
30
  const metadata = this.reflector.get(necord_constants_1.OPTIONS_METADATA, target[methodName]);
31
- return metadata.sort((a, b) => a.parameterIndex - b.parameterIndex);
31
+ return metadata === null || metadata === void 0 ? void 0 : metadata.sort((a, b) => a.parameterIndex - b.parameterIndex);
32
32
  }
33
33
  };
34
34
  MetadataAccessorService = __decorate([
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "license": "MIT",
3
3
  "name": "necord",
4
- "version": "1.0.5",
4
+ "version": "1.0.8",
5
5
  "description": "A Discord bot framework built on top of Discord.js and Nest.js for advanced and amazing bots.",
6
6
  "keywords": [
7
7
  "nest",
@@ -31,7 +31,7 @@
31
31
  "publish:npm": "npm publish --access public",
32
32
  "prepare": "husky install .github/husky",
33
33
  "test": "",
34
- "lint": "eslint --ignore-path .gitignore {integration,sample,src}/**/*.ts"
34
+ "lint": "eslint --ignore-path .gitignore {integration,src}/**/*.ts"
35
35
  },
36
36
  "lint-staged": {
37
37
  "*.ts": [