necord 5.2.0-dev.1663245459.9f9fe8c → 5.3.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.
Files changed (161) hide show
  1. package/dist/commands/command.discovery.d.ts +8 -8
  2. package/dist/commands/command.discovery.js +13 -13
  3. package/dist/commands/commands.service.d.ts +14 -14
  4. package/dist/commands/commands.service.js +74 -74
  5. package/dist/commands/context-menus/context-menu.discovery.d.ts +11 -11
  6. package/dist/commands/context-menus/context-menu.discovery.js +19 -19
  7. package/dist/commands/context-menus/context-menus.service.d.ts +14 -14
  8. package/dist/commands/context-menus/context-menus.service.js +46 -46
  9. package/dist/commands/context-menus/decorators/context-menu.decorator.d.ts +2 -2
  10. package/dist/commands/context-menus/decorators/context-menu.decorator.js +8 -8
  11. package/dist/commands/context-menus/decorators/index.d.ts +4 -4
  12. package/dist/commands/context-menus/decorators/index.js +20 -20
  13. package/dist/commands/context-menus/decorators/message-command.decorator.d.ts +2 -2
  14. package/dist/commands/context-menus/decorators/message-command.decorator.js +7 -7
  15. package/dist/commands/context-menus/decorators/target.decorator.d.ts +1 -1
  16. package/dist/commands/context-menus/decorators/target.decorator.js +14 -14
  17. package/dist/commands/context-menus/decorators/user-command.decorator.d.ts +2 -2
  18. package/dist/commands/context-menus/decorators/user-command.decorator.js +7 -7
  19. package/dist/commands/context-menus/index.d.ts +3 -3
  20. package/dist/commands/context-menus/index.js +19 -19
  21. package/dist/commands/index.d.ts +4 -4
  22. package/dist/commands/index.js +20 -20
  23. package/dist/commands/slash-commands/autocomplete/autocomplete.interceptor.d.ts +7 -7
  24. package/dist/commands/slash-commands/autocomplete/autocomplete.interceptor.js +39 -39
  25. package/dist/commands/slash-commands/autocomplete/index.d.ts +1 -1
  26. package/dist/commands/slash-commands/autocomplete/index.js +17 -17
  27. package/dist/commands/slash-commands/decorators/index.d.ts +3 -3
  28. package/dist/commands/slash-commands/decorators/index.js +19 -19
  29. package/dist/commands/slash-commands/decorators/slash-command.decorator.d.ts +2 -2
  30. package/dist/commands/slash-commands/decorators/slash-command.decorator.js +9 -9
  31. package/dist/commands/slash-commands/decorators/subcommand-group.decorator.d.ts +2 -2
  32. package/dist/commands/slash-commands/decorators/subcommand-group.decorator.js +18 -18
  33. package/dist/commands/slash-commands/decorators/subcommand.decorator.d.ts +2 -2
  34. package/dist/commands/slash-commands/decorators/subcommand.decorator.js +9 -9
  35. package/dist/commands/slash-commands/index.d.ts +5 -5
  36. package/dist/commands/slash-commands/index.js +21 -21
  37. package/dist/commands/slash-commands/options/attachment-option.decorator.d.ts +7 -7
  38. package/dist/commands/slash-commands/options/attachment-option.decorator.js +6 -6
  39. package/dist/commands/slash-commands/options/boolean-option.decorator.d.ts +7 -7
  40. package/dist/commands/slash-commands/options/boolean-option.decorator.js +6 -6
  41. package/dist/commands/slash-commands/options/channel-option.decorator.d.ts +8 -8
  42. package/dist/commands/slash-commands/options/channel-option.decorator.js +6 -6
  43. package/dist/commands/slash-commands/options/index.d.ts +11 -11
  44. package/dist/commands/slash-commands/options/index.js +27 -27
  45. package/dist/commands/slash-commands/options/integer-option.decorator.d.ts +20 -20
  46. package/dist/commands/slash-commands/options/integer-option.decorator.js +6 -6
  47. package/dist/commands/slash-commands/options/member-option.decorator.d.ts +7 -7
  48. package/dist/commands/slash-commands/options/member-option.decorator.js +6 -6
  49. package/dist/commands/slash-commands/options/mentionable-option.decorator.d.ts +7 -7
  50. package/dist/commands/slash-commands/options/mentionable-option.decorator.js +6 -6
  51. package/dist/commands/slash-commands/options/number-option.decorator.d.ts +20 -20
  52. package/dist/commands/slash-commands/options/number-option.decorator.js +6 -6
  53. package/dist/commands/slash-commands/options/option.util.d.ts +5 -5
  54. package/dist/commands/slash-commands/options/option.util.js +21 -21
  55. package/dist/commands/slash-commands/options/options.decorator.d.ts +2 -2
  56. package/dist/commands/slash-commands/options/options.decorator.js +32 -32
  57. package/dist/commands/slash-commands/options/role-option.decorator.d.ts +7 -7
  58. package/dist/commands/slash-commands/options/role-option.decorator.js +6 -6
  59. package/dist/commands/slash-commands/options/string-option.decorator.d.ts +20 -20
  60. package/dist/commands/slash-commands/options/string-option.decorator.js +6 -6
  61. package/dist/commands/slash-commands/options/user-option.decorator.d.ts +7 -7
  62. package/dist/commands/slash-commands/options/user-option.decorator.js +6 -6
  63. package/dist/commands/slash-commands/slash-command.discovery.d.ts +20 -20
  64. package/dist/commands/slash-commands/slash-command.discovery.js +44 -44
  65. package/dist/commands/slash-commands/slash-commands.service.d.ts +16 -16
  66. package/dist/commands/slash-commands/slash-commands.service.js +77 -77
  67. package/dist/context/decorators/context.decorator.d.ts +2 -2
  68. package/dist/context/decorators/context.decorator.js +7 -7
  69. package/dist/context/decorators/discovery.decorator.d.ts +1 -1
  70. package/dist/context/decorators/discovery.decorator.js +6 -6
  71. package/dist/context/decorators/index.d.ts +2 -2
  72. package/dist/context/decorators/index.js +18 -18
  73. package/dist/context/decorators/params.util.d.ts +3 -3
  74. package/dist/context/decorators/params.util.js +12 -12
  75. package/dist/context/index.d.ts +7 -7
  76. package/dist/context/index.js +23 -23
  77. package/dist/context/necord-arguments-host.d.ts +13 -13
  78. package/dist/context/necord-arguments-host.js +22 -22
  79. package/dist/context/necord-base.discovery.d.ts +30 -30
  80. package/dist/context/necord-base.discovery.js +47 -47
  81. package/dist/context/necord-context.interface.d.ts +11 -11
  82. package/dist/context/necord-context.interface.js +2 -2
  83. package/dist/context/necord-execution-context.d.ts +6 -6
  84. package/dist/context/necord-execution-context.js +13 -13
  85. package/dist/context/necord-params.factory.d.ts +6 -6
  86. package/dist/context/necord-params.factory.js +19 -19
  87. package/dist/context/necord-paramtype.enum.d.ts +4 -4
  88. package/dist/context/necord-paramtype.enum.js +8 -8
  89. package/dist/index.d.ts +9 -9
  90. package/dist/index.js +25 -25
  91. package/dist/listeners/decorators/index.d.ts +3 -3
  92. package/dist/listeners/decorators/index.js +19 -19
  93. package/dist/listeners/decorators/listener.decorator.d.ts +2 -2
  94. package/dist/listeners/decorators/listener.decorator.js +8 -8
  95. package/dist/listeners/decorators/on.decorator.d.ts +2 -2
  96. package/dist/listeners/decorators/on.decorator.js +6 -6
  97. package/dist/listeners/decorators/once.decorator.d.ts +2 -2
  98. package/dist/listeners/decorators/once.decorator.js +6 -6
  99. package/dist/listeners/index.d.ts +3 -3
  100. package/dist/listeners/index.js +19 -19
  101. package/dist/listeners/listener.discovery.d.ts +11 -11
  102. package/dist/listeners/listener.discovery.js +19 -19
  103. package/dist/listeners/listener.interface.d.ts +90 -90
  104. package/dist/listeners/listener.interface.js +2 -2
  105. package/dist/listeners/listeners.service.d.ts +22 -22
  106. package/dist/listeners/listeners.service.js +237 -237
  107. package/dist/message-components/decorators/button.decorator.d.ts +1 -1
  108. package/dist/message-components/decorators/button.decorator.js +7 -7
  109. package/dist/message-components/decorators/component-param.decorator.d.ts +1 -1
  110. package/dist/message-components/decorators/component-param.decorator.js +17 -17
  111. package/dist/message-components/decorators/index.d.ts +5 -5
  112. package/dist/message-components/decorators/index.js +21 -21
  113. package/dist/message-components/decorators/message-component.decorator.d.ts +2 -2
  114. package/dist/message-components/decorators/message-component.decorator.js +8 -8
  115. package/dist/message-components/decorators/select-menu.decorator.d.ts +1 -1
  116. package/dist/message-components/decorators/select-menu.decorator.js +7 -7
  117. package/dist/message-components/decorators/values.decorator.d.ts +1 -1
  118. package/dist/message-components/decorators/values.decorator.js +10 -10
  119. package/dist/message-components/index.d.ts +3 -3
  120. package/dist/message-components/index.js +19 -19
  121. package/dist/message-components/message-component.discovery.d.ts +14 -14
  122. package/dist/message-components/message-component.discovery.js +27 -27
  123. package/dist/message-components/message-components.service.d.ts +12 -12
  124. package/dist/message-components/message-components.service.js +46 -46
  125. package/dist/modals/decorators/fields.decorator.d.ts +1 -1
  126. package/dist/modals/decorators/fields.decorator.js +14 -14
  127. package/dist/modals/decorators/index.d.ts +3 -3
  128. package/dist/modals/decorators/index.js +19 -19
  129. package/dist/modals/decorators/modal-param.decorator.d.ts +1 -1
  130. package/dist/modals/decorators/modal-param.decorator.js +17 -17
  131. package/dist/modals/decorators/modal.decorator.d.ts +1 -1
  132. package/dist/modals/decorators/modal.decorator.js +8 -8
  133. package/dist/modals/index.d.ts +3 -3
  134. package/dist/modals/index.js +19 -19
  135. package/dist/modals/modal.discovery.d.ts +12 -12
  136. package/dist/modals/modal.discovery.js +24 -24
  137. package/dist/modals/modals.service.d.ts +12 -12
  138. package/dist/modals/modals.service.js +46 -46
  139. package/dist/necord-client.provider.d.ts +3 -3
  140. package/dist/necord-client.provider.js +10 -10
  141. package/dist/necord-explorer.service.d.ts +15 -15
  142. package/dist/necord-explorer.service.js +59 -59
  143. package/dist/necord-options.interface.d.ts +16 -16
  144. package/dist/necord-options.interface.js +2 -2
  145. package/dist/necord.constants.d.ts +11 -11
  146. package/dist/necord.constants.js +14 -14
  147. package/dist/necord.module.d.ts +14 -14
  148. package/dist/necord.module.js +115 -115
  149. package/dist/text-commands/decorators/arguments.decorator.d.ts +2 -2
  150. package/dist/text-commands/decorators/arguments.decorator.js +14 -14
  151. package/dist/text-commands/decorators/index.d.ts +2 -2
  152. package/dist/text-commands/decorators/index.js +18 -18
  153. package/dist/text-commands/decorators/text-command.decorator.d.ts +2 -2
  154. package/dist/text-commands/decorators/text-command.decorator.js +8 -8
  155. package/dist/text-commands/index.d.ts +3 -3
  156. package/dist/text-commands/index.js +19 -19
  157. package/dist/text-commands/text-command.discovery.d.ts +11 -11
  158. package/dist/text-commands/text-command.discovery.js +19 -19
  159. package/dist/text-commands/text-commands.service.d.ts +14 -14
  160. package/dist/text-commands/text-commands.service.js +66 -66
  161. package/package.json +5 -5
@@ -1,77 +1,77 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
- return new (P || (P = Promise))(function (resolve, reject) {
14
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
- step((generator = generator.apply(thisArg, _arguments || [])).next());
18
- });
19
- };
20
- Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.SlashCommandsService = void 0;
22
- const common_1 = require("@nestjs/common");
23
- const discord_js_1 = require("discord.js");
24
- const necord_constants_1 = require("../../necord.constants");
25
- const necord_explorer_service_1 = require("../../necord-explorer.service");
26
- const core_1 = require("@nestjs/core");
27
- let SlashCommandsService = class SlashCommandsService {
28
- constructor(client, explorerService, reflector) {
29
- this.client = client;
30
- this.explorerService = explorerService;
31
- this.reflector = reflector;
32
- this.slashCommands = new Map();
33
- }
34
- onModuleInit() {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- this.explorerService
37
- .explore(necord_constants_1.SLASH_COMMAND_METADATA)
38
- .forEach(command => this.slashCommands.set(command.getName(), command));
39
- return this.explorerService.explore(necord_constants_1.SUBCOMMAND_METADATA).forEach(subcommand => {
40
- const rootCommand = this.reflector.get(necord_constants_1.SLASH_COMMAND_METADATA, subcommand.getClass());
41
- const subCommandGroup = this.reflector.get(necord_constants_1.SUBCOMMAND_GROUP_METADATA, subcommand.getClass());
42
- if (!rootCommand) {
43
- throw new ReferenceError(`can't register subcommand "${subcommand.getName()}" w/o root command`);
44
- }
45
- if (subCommandGroup) {
46
- subCommandGroup.setCommand(subcommand);
47
- rootCommand.setCommand(subCommandGroup);
48
- }
49
- else {
50
- rootCommand.setCommand(subcommand);
51
- }
52
- if (!this.slashCommands.has(rootCommand.getName())) {
53
- this.slashCommands.set(rootCommand.getName(), rootCommand);
54
- }
55
- });
56
- });
57
- }
58
- onApplicationBootstrap() {
59
- return this.client.on('interactionCreate', i => {
60
- var _a;
61
- if (!i.isChatInputCommand() &&
62
- i.type !== discord_js_1.InteractionType.ApplicationCommandAutocomplete)
63
- return;
64
- return (_a = this.slashCommands.get(i.commandName)) === null || _a === void 0 ? void 0 : _a.execute(i);
65
- });
66
- }
67
- getCommands() {
68
- return [...this.slashCommands.values()];
69
- }
70
- };
71
- SlashCommandsService = __decorate([
72
- (0, common_1.Injectable)(),
73
- __metadata("design:paramtypes", [discord_js_1.Client,
74
- necord_explorer_service_1.ExplorerService,
75
- core_1.Reflector])
76
- ], SlashCommandsService);
77
- exports.SlashCommandsService = SlashCommandsService;
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.SlashCommandsService = void 0;
22
+ const common_1 = require("@nestjs/common");
23
+ const discord_js_1 = require("discord.js");
24
+ const necord_constants_1 = require("../../necord.constants");
25
+ const necord_explorer_service_1 = require("../../necord-explorer.service");
26
+ const core_1 = require("@nestjs/core");
27
+ let SlashCommandsService = class SlashCommandsService {
28
+ constructor(client, explorerService, reflector) {
29
+ this.client = client;
30
+ this.explorerService = explorerService;
31
+ this.reflector = reflector;
32
+ this.slashCommands = new Map();
33
+ }
34
+ onModuleInit() {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ this.explorerService
37
+ .explore(necord_constants_1.SLASH_COMMAND_METADATA)
38
+ .forEach(command => this.slashCommands.set(command.getName(), command));
39
+ return this.explorerService.explore(necord_constants_1.SUBCOMMAND_METADATA).forEach(subcommand => {
40
+ const rootCommand = this.reflector.get(necord_constants_1.SLASH_COMMAND_METADATA, subcommand.getClass());
41
+ const subCommandGroup = this.reflector.get(necord_constants_1.SUBCOMMAND_GROUP_METADATA, subcommand.getClass());
42
+ if (!rootCommand) {
43
+ throw new ReferenceError(`can't register subcommand "${subcommand.getName()}" w/o root command`);
44
+ }
45
+ if (subCommandGroup) {
46
+ subCommandGroup.setCommand(subcommand);
47
+ rootCommand.setCommand(subCommandGroup);
48
+ }
49
+ else {
50
+ rootCommand.setCommand(subcommand);
51
+ }
52
+ if (!this.slashCommands.has(rootCommand.getName())) {
53
+ this.slashCommands.set(rootCommand.getName(), rootCommand);
54
+ }
55
+ });
56
+ });
57
+ }
58
+ onApplicationBootstrap() {
59
+ return this.client.on('interactionCreate', i => {
60
+ var _a;
61
+ if (!i.isChatInputCommand() &&
62
+ i.type !== discord_js_1.InteractionType.ApplicationCommandAutocomplete)
63
+ return;
64
+ return (_a = this.slashCommands.get(i.commandName)) === null || _a === void 0 ? void 0 : _a.execute(i);
65
+ });
66
+ }
67
+ getCommands() {
68
+ return [...this.slashCommands.values()];
69
+ }
70
+ };
71
+ SlashCommandsService = __decorate([
72
+ (0, common_1.Injectable)(),
73
+ __metadata("design:paramtypes", [discord_js_1.Client,
74
+ necord_explorer_service_1.ExplorerService,
75
+ core_1.Reflector])
76
+ ], SlashCommandsService);
77
+ exports.SlashCommandsService = SlashCommandsService;
@@ -1,2 +1,2 @@
1
- export declare const Context: (...pipes: (import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
2
- export declare const Ctx: (...pipes: (import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
1
+ export declare const Context: (...pipes: (import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
2
+ export declare const Ctx: (...pipes: (import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Ctx = exports.Context = void 0;
4
- const necord_paramtype_enum_1 = require("../necord-paramtype.enum");
5
- const params_util_1 = require("./params.util");
6
- exports.Context = (0, params_util_1.createNecordParamDecorator)(necord_paramtype_enum_1.NecordParamType.CONTEXT);
7
- exports.Ctx = exports.Context;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Ctx = exports.Context = void 0;
4
+ const necord_paramtype_enum_1 = require("../necord-paramtype.enum");
5
+ const params_util_1 = require("./params.util");
6
+ exports.Context = (0, params_util_1.createNecordParamDecorator)(necord_paramtype_enum_1.NecordParamType.CONTEXT);
7
+ exports.Ctx = exports.Context;
@@ -1 +1 @@
1
- export declare const Discovery: (...pipes: (import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
1
+ export declare const Discovery: (...pipes: (import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
@@ -1,6 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Discovery = void 0;
4
- const necord_paramtype_enum_1 = require("../necord-paramtype.enum");
5
- const params_util_1 = require("./params.util");
6
- exports.Discovery = (0, params_util_1.createNecordParamDecorator)(necord_paramtype_enum_1.NecordParamType.DISCOVERY);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Discovery = void 0;
4
+ const necord_paramtype_enum_1 = require("../necord-paramtype.enum");
5
+ const params_util_1 = require("./params.util");
6
+ exports.Discovery = (0, params_util_1.createNecordParamDecorator)(necord_paramtype_enum_1.NecordParamType.DISCOVERY);
@@ -1,2 +1,2 @@
1
- export * from './context.decorator';
2
- export * from './discovery.decorator';
1
+ export * from './context.decorator';
2
+ export * from './discovery.decorator';
@@ -1,18 +1,18 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./context.decorator"), exports);
18
- __exportStar(require("./discovery.decorator"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./context.decorator"), exports);
18
+ __exportStar(require("./discovery.decorator"), exports);
@@ -1,3 +1,3 @@
1
- import { NecordParamType } from '../necord-paramtype.enum';
2
- import { PipeTransform, Type } from '@nestjs/common';
3
- export declare function createNecordParamDecorator(type: NecordParamType): (...pipes: (Type<PipeTransform> | PipeTransform)[]) => ParameterDecorator;
1
+ import { NecordParamType } from '../necord-paramtype.enum';
2
+ import { PipeTransform, Type } from '@nestjs/common';
3
+ export declare function createNecordParamDecorator(type: NecordParamType): (...pipes: (Type<PipeTransform> | PipeTransform)[]) => ParameterDecorator;
@@ -1,12 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createNecordParamDecorator = void 0;
4
- const common_1 = require("@nestjs/common");
5
- const constants_1 = require("@nestjs/common/constants");
6
- function createNecordParamDecorator(type) {
7
- return (...pipes) => (target, key, index) => {
8
- const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target.constructor, key) || {};
9
- Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, (0, common_1.assignMetadata)(args, type, index, undefined, ...pipes), target.constructor, key);
10
- };
11
- }
12
- exports.createNecordParamDecorator = createNecordParamDecorator;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createNecordParamDecorator = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const constants_1 = require("@nestjs/common/constants");
6
+ function createNecordParamDecorator(type) {
7
+ return (...pipes) => (target, key, index) => {
8
+ const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target.constructor, key) || {};
9
+ Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, (0, common_1.assignMetadata)(args, type, index, undefined, ...pipes), target.constructor, key);
10
+ };
11
+ }
12
+ exports.createNecordParamDecorator = createNecordParamDecorator;
@@ -1,7 +1,7 @@
1
- export * from './decorators';
2
- export * from './necord-arguments-host';
3
- export * from './necord-base.discovery';
4
- export * from './necord-context.interface';
5
- export * from './necord-execution-context';
6
- export * from './necord-params.factory';
7
- export * from './necord-paramtype.enum';
1
+ export * from './decorators';
2
+ export * from './necord-arguments-host';
3
+ export * from './necord-base.discovery';
4
+ export * from './necord-context.interface';
5
+ export * from './necord-execution-context';
6
+ export * from './necord-params.factory';
7
+ export * from './necord-paramtype.enum';
@@ -1,23 +1,23 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./decorators"), exports);
18
- __exportStar(require("./necord-arguments-host"), exports);
19
- __exportStar(require("./necord-base.discovery"), exports);
20
- __exportStar(require("./necord-context.interface"), exports);
21
- __exportStar(require("./necord-execution-context"), exports);
22
- __exportStar(require("./necord-params.factory"), exports);
23
- __exportStar(require("./necord-paramtype.enum"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./decorators"), exports);
18
+ __exportStar(require("./necord-arguments-host"), exports);
19
+ __exportStar(require("./necord-base.discovery"), exports);
20
+ __exportStar(require("./necord-context.interface"), exports);
21
+ __exportStar(require("./necord-execution-context"), exports);
22
+ __exportStar(require("./necord-params.factory"), exports);
23
+ __exportStar(require("./necord-paramtype.enum"), exports);
@@ -1,13 +1,13 @@
1
- import { ExecutionContextHost } from '@nestjs/core/helpers/execution-context-host';
2
- import { ArgumentsHost } from '@nestjs/common';
3
- import { NecordContextType } from './necord-execution-context';
4
- import { ClientEvents } from 'discord.js';
5
- import { NecordBaseDiscovery } from '../context';
6
- import { ContextOf } from './necord-context.interface';
7
- export declare class NecordArgumentsHost extends ExecutionContextHost {
8
- static create(context: ArgumentsHost): NecordArgumentsHost;
9
- getType<TContext extends string = NecordContextType>(): TContext;
10
- getContext<T extends keyof ClientEvents>(): ContextOf<T>;
11
- getContext<T>(): T;
12
- getDiscovery(): NecordBaseDiscovery;
13
- }
1
+ import { ExecutionContextHost } from '@nestjs/core/helpers/execution-context-host';
2
+ import { ArgumentsHost } from '@nestjs/common';
3
+ import { NecordContextType } from './necord-execution-context';
4
+ import { ClientEvents } from 'discord.js';
5
+ import { NecordBaseDiscovery } from '../context';
6
+ import { ContextOf } from './necord-context.interface';
7
+ export declare class NecordArgumentsHost extends ExecutionContextHost {
8
+ static create(context: ArgumentsHost): NecordArgumentsHost;
9
+ getType<TContext extends string = NecordContextType>(): TContext;
10
+ getContext<T extends keyof ClientEvents>(): ContextOf<T>;
11
+ getContext<T>(): T;
12
+ getDiscovery(): NecordBaseDiscovery;
13
+ }
@@ -1,22 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NecordArgumentsHost = void 0;
4
- const execution_context_host_1 = require("@nestjs/core/helpers/execution-context-host");
5
- class NecordArgumentsHost extends execution_context_host_1.ExecutionContextHost {
6
- static create(context) {
7
- const type = context.getType();
8
- const necContext = new NecordArgumentsHost(context.getArgs());
9
- necContext.setType(type);
10
- return necContext;
11
- }
12
- getType() {
13
- return super.getType();
14
- }
15
- getContext() {
16
- return this.getArgByIndex(0);
17
- }
18
- getDiscovery() {
19
- return this.getArgByIndex(1);
20
- }
21
- }
22
- exports.NecordArgumentsHost = NecordArgumentsHost;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NecordArgumentsHost = void 0;
4
+ const execution_context_host_1 = require("@nestjs/core/helpers/execution-context-host");
5
+ class NecordArgumentsHost extends execution_context_host_1.ExecutionContextHost {
6
+ static create(context) {
7
+ const type = context.getType();
8
+ const necContext = new NecordArgumentsHost(context.getArgs());
9
+ necContext.setType(type);
10
+ return necContext;
11
+ }
12
+ getType() {
13
+ return super.getType();
14
+ }
15
+ getContext() {
16
+ return this.getArgByIndex(0);
17
+ }
18
+ getDiscovery() {
19
+ return this.getArgByIndex(1);
20
+ }
21
+ }
22
+ exports.NecordArgumentsHost = NecordArgumentsHost;
@@ -1,30 +1,30 @@
1
- import { Reflector } from '@nestjs/core';
2
- import { ContextMenuDiscovery, SlashCommandDiscovery } from '../commands';
3
- import { MessageComponentDiscovery } from '../message-components';
4
- import { ListenerDiscovery } from '../listeners';
5
- import { TextCommandDiscovery } from '../text-commands';
6
- import { ModalDiscovery } from '../modals';
7
- interface DiscoveredItem {
8
- class: any;
9
- handler?: (...args: any[]) => any;
10
- }
11
- export declare abstract class NecordBaseDiscovery<T = any> {
12
- protected readonly meta: T;
13
- protected readonly reflector: Reflector;
14
- protected discovery: DiscoveredItem;
15
- protected contextCallback: Function;
16
- constructor(meta: T);
17
- getClass(): any;
18
- getHandler(): (...args: any[]) => any;
19
- setDiscoveryMeta(meta: DiscoveredItem): void;
20
- setContextCallback(fn: Function): void;
21
- execute(context?: any): any;
22
- isContextMenu(): this is ContextMenuDiscovery;
23
- isSlashCommand(): this is SlashCommandDiscovery;
24
- isMessageComponent(): this is MessageComponentDiscovery;
25
- isListener(): this is ListenerDiscovery;
26
- isTextCommand(): this is TextCommandDiscovery;
27
- isModal(): this is ModalDiscovery;
28
- abstract toJSON(): Record<string, any>;
29
- }
30
- export {};
1
+ import { Reflector } from '@nestjs/core';
2
+ import { ContextMenuDiscovery, SlashCommandDiscovery } from '../commands';
3
+ import { MessageComponentDiscovery } from '../message-components';
4
+ import { ListenerDiscovery } from '../listeners';
5
+ import { TextCommandDiscovery } from '../text-commands';
6
+ import { ModalDiscovery } from '../modals';
7
+ interface DiscoveredItem {
8
+ class: any;
9
+ handler?: (...args: any[]) => any;
10
+ }
11
+ export declare abstract class NecordBaseDiscovery<T = any> {
12
+ protected readonly meta: T;
13
+ protected readonly reflector: Reflector;
14
+ protected discovery: DiscoveredItem;
15
+ protected contextCallback: Function;
16
+ constructor(meta: T);
17
+ getClass(): any;
18
+ getHandler(): (...args: any[]) => any;
19
+ setDiscoveryMeta(meta: DiscoveredItem): void;
20
+ setContextCallback(fn: Function): void;
21
+ execute(context?: any): any;
22
+ isContextMenu(): this is ContextMenuDiscovery;
23
+ isSlashCommand(): this is SlashCommandDiscovery;
24
+ isMessageComponent(): this is MessageComponentDiscovery;
25
+ isListener(): this is ListenerDiscovery;
26
+ isTextCommand(): this is TextCommandDiscovery;
27
+ isModal(): this is ModalDiscovery;
28
+ abstract toJSON(): Record<string, any>;
29
+ }
30
+ export {};
@@ -1,47 +1,47 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NecordBaseDiscovery = void 0;
4
- const core_1 = require("@nestjs/core");
5
- // TODO: Move TypeGuards to ExecutionContext
6
- class NecordBaseDiscovery {
7
- constructor(meta) {
8
- this.meta = meta;
9
- this.reflector = new core_1.Reflector();
10
- }
11
- getClass() {
12
- return this.discovery.class;
13
- }
14
- getHandler() {
15
- return this.discovery.handler;
16
- }
17
- setDiscoveryMeta(meta) {
18
- var _a;
19
- (_a = this.discovery) !== null && _a !== void 0 ? _a : (this.discovery = meta);
20
- }
21
- setContextCallback(fn) {
22
- var _a;
23
- (_a = this.contextCallback) !== null && _a !== void 0 ? _a : (this.contextCallback = fn);
24
- }
25
- execute(context = []) {
26
- return this.contextCallback(context, this);
27
- }
28
- isContextMenu() {
29
- return false;
30
- }
31
- isSlashCommand() {
32
- return false;
33
- }
34
- isMessageComponent() {
35
- return false;
36
- }
37
- isListener() {
38
- return false;
39
- }
40
- isTextCommand() {
41
- return false;
42
- }
43
- isModal() {
44
- return false;
45
- }
46
- }
47
- exports.NecordBaseDiscovery = NecordBaseDiscovery;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NecordBaseDiscovery = void 0;
4
+ const core_1 = require("@nestjs/core");
5
+ // TODO: Move TypeGuards to ExecutionContext
6
+ class NecordBaseDiscovery {
7
+ constructor(meta) {
8
+ this.meta = meta;
9
+ this.reflector = new core_1.Reflector();
10
+ }
11
+ getClass() {
12
+ return this.discovery.class;
13
+ }
14
+ getHandler() {
15
+ return this.discovery.handler;
16
+ }
17
+ setDiscoveryMeta(meta) {
18
+ var _a;
19
+ (_a = this.discovery) !== null && _a !== void 0 ? _a : (this.discovery = meta);
20
+ }
21
+ setContextCallback(fn) {
22
+ var _a;
23
+ (_a = this.contextCallback) !== null && _a !== void 0 ? _a : (this.contextCallback = fn);
24
+ }
25
+ execute(context = []) {
26
+ return this.contextCallback(context, this);
27
+ }
28
+ isContextMenu() {
29
+ return false;
30
+ }
31
+ isSlashCommand() {
32
+ return false;
33
+ }
34
+ isMessageComponent() {
35
+ return false;
36
+ }
37
+ isListener() {
38
+ return false;
39
+ }
40
+ isTextCommand() {
41
+ return false;
42
+ }
43
+ isModal() {
44
+ return false;
45
+ }
46
+ }
47
+ exports.NecordBaseDiscovery = NecordBaseDiscovery;
@@ -1,11 +1,11 @@
1
- import { AutocompleteInteraction, ButtonInteraction, ChatInputCommandInteraction, Message, MessageContextMenuCommandInteraction, ModalSubmitInteraction, SelectMenuInteraction, UserContextMenuCommandInteraction } from 'discord.js';
2
- import { NecordEvents } from '../listeners/listener.interface';
3
- export declare type AutocompleteContext = [AutocompleteInteraction];
4
- export declare type SlashCommandContext = [ChatInputCommandInteraction];
5
- export declare type TextCommandContext = [Message];
6
- export declare type MessageCommandContext = [MessageContextMenuCommandInteraction];
7
- export declare type UserCommandContext = [UserContextMenuCommandInteraction];
8
- export declare type ModalContext = [ModalSubmitInteraction];
9
- export declare type ButtonContext = [ButtonInteraction];
10
- export declare type SelectMenuContext = [SelectMenuInteraction];
11
- export declare type ContextOf<K extends keyof E, E = NecordEvents> = E[K];
1
+ import { AutocompleteInteraction, ButtonInteraction, ChatInputCommandInteraction, Message, MessageContextMenuCommandInteraction, ModalSubmitInteraction, SelectMenuInteraction, UserContextMenuCommandInteraction } from 'discord.js';
2
+ import { NecordEvents } from '../listeners/listener.interface';
3
+ export declare type AutocompleteContext = [AutocompleteInteraction];
4
+ export declare type SlashCommandContext = [ChatInputCommandInteraction];
5
+ export declare type TextCommandContext = [Message];
6
+ export declare type MessageCommandContext = [MessageContextMenuCommandInteraction];
7
+ export declare type UserCommandContext = [UserContextMenuCommandInteraction];
8
+ export declare type ModalContext = [ModalSubmitInteraction];
9
+ export declare type ButtonContext = [ButtonInteraction];
10
+ export declare type SelectMenuContext = [SelectMenuInteraction];
11
+ export declare type ContextOf<K extends keyof E, E = NecordEvents> = E[K];
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,6 @@
1
- import { ContextType, ExecutionContext } from '@nestjs/common';
2
- import { NecordArgumentsHost } from './necord-arguments-host';
3
- export declare type NecordContextType = 'necord' | ContextType;
4
- export declare class NecordExecutionContext extends NecordArgumentsHost {
5
- static create(context: ExecutionContext): NecordExecutionContext;
6
- }
1
+ import { ContextType, ExecutionContext } from '@nestjs/common';
2
+ import { NecordArgumentsHost } from './necord-arguments-host';
3
+ export declare type NecordContextType = 'necord' | ContextType;
4
+ export declare class NecordExecutionContext extends NecordArgumentsHost {
5
+ static create(context: ExecutionContext): NecordExecutionContext;
6
+ }