necord 3.0.3 → 3.0.4
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.
package/dist/necord.module.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Client } from 'discord.js';
|
|
2
1
|
import { DynamicModule, OnApplicationBootstrap, OnApplicationShutdown } from '@nestjs/common';
|
|
2
|
+
import { Client } from 'discord.js';
|
|
3
3
|
import { NecordModuleAsyncOptions, NecordModuleOptions } from './interfaces';
|
|
4
4
|
export declare class NecordModule implements OnApplicationBootstrap, OnApplicationShutdown {
|
|
5
5
|
private readonly options;
|
package/dist/necord.module.js
CHANGED
|
@@ -23,11 +23,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
23
|
var NecordModule_1;
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
exports.NecordModule = void 0;
|
|
26
|
-
const discord_js_1 = require("discord.js");
|
|
27
26
|
const common_1 = require("@nestjs/common");
|
|
27
|
+
const discord_js_1 = require("discord.js");
|
|
28
28
|
const core_1 = require("@nestjs/core");
|
|
29
29
|
const necord_constants_1 = require("./necord.constants");
|
|
30
30
|
const services_1 = require("./services");
|
|
31
|
+
const necord_update_1 = require("./necord.update");
|
|
31
32
|
let NecordModule = NecordModule_1 = class NecordModule {
|
|
32
33
|
constructor(options, client) {
|
|
33
34
|
this.options = options;
|
|
@@ -100,7 +101,14 @@ NecordModule = NecordModule_1 = __decorate([
|
|
|
100
101
|
(0, common_1.Global)(),
|
|
101
102
|
(0, common_1.Module)({
|
|
102
103
|
imports: [core_1.DiscoveryModule],
|
|
103
|
-
providers: [
|
|
104
|
+
providers: [
|
|
105
|
+
services_1.CommandsService,
|
|
106
|
+
services_1.ComponentsService,
|
|
107
|
+
services_1.ListenersService,
|
|
108
|
+
services_1.ExplorerService,
|
|
109
|
+
services_1.MetadataAccessorService,
|
|
110
|
+
necord_update_1.NecordUpdate
|
|
111
|
+
]
|
|
104
112
|
}),
|
|
105
113
|
__param(0, (0, common_1.Inject)(necord_constants_1.NECORD_MODULE_OPTIONS)),
|
|
106
114
|
__metadata("design:paramtypes", [Object, discord_js_1.Client])
|
|
@@ -0,0 +1,69 @@
|
|
|
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 __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var NecordUpdate_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.NecordUpdate = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const decorators_1 = require("./decorators");
|
|
19
|
+
let NecordUpdate = NecordUpdate_1 = class NecordUpdate {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.logger = new common_1.Logger(NecordUpdate_1.name);
|
|
22
|
+
}
|
|
23
|
+
onWarn(message) {
|
|
24
|
+
if (!NecordUpdate_1.isDebugMode()) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
return this.logger.warn(message);
|
|
28
|
+
}
|
|
29
|
+
onError(error) {
|
|
30
|
+
if (!NecordUpdate_1.isDebugMode()) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
return this.logger.error(error);
|
|
34
|
+
}
|
|
35
|
+
onDebug(message) {
|
|
36
|
+
if (!NecordUpdate_1.isDebugMode()) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
return this.logger.debug(message);
|
|
40
|
+
}
|
|
41
|
+
static isDebugMode() {
|
|
42
|
+
return !!process.env.NEST_DEBUG;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, decorators_1.On)('warn'),
|
|
47
|
+
__param(0, (0, decorators_1.Context)()),
|
|
48
|
+
__metadata("design:type", Function),
|
|
49
|
+
__metadata("design:paramtypes", [String]),
|
|
50
|
+
__metadata("design:returntype", void 0)
|
|
51
|
+
], NecordUpdate.prototype, "onWarn", null);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, decorators_1.On)('error'),
|
|
54
|
+
__param(0, (0, decorators_1.Context)()),
|
|
55
|
+
__metadata("design:type", Function),
|
|
56
|
+
__metadata("design:paramtypes", [Error]),
|
|
57
|
+
__metadata("design:returntype", void 0)
|
|
58
|
+
], NecordUpdate.prototype, "onError", null);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, decorators_1.On)('debug'),
|
|
61
|
+
__param(0, (0, decorators_1.Context)()),
|
|
62
|
+
__metadata("design:type", Function),
|
|
63
|
+
__metadata("design:paramtypes", [String]),
|
|
64
|
+
__metadata("design:returntype", void 0)
|
|
65
|
+
], NecordUpdate.prototype, "onDebug", null);
|
|
66
|
+
NecordUpdate = NecordUpdate_1 = __decorate([
|
|
67
|
+
(0, common_1.Injectable)()
|
|
68
|
+
], NecordUpdate);
|
|
69
|
+
exports.NecordUpdate = NecordUpdate;
|
|
@@ -111,7 +111,7 @@ let CommandsService = CommandsService_1 = class CommandsService {
|
|
|
111
111
|
}
|
|
112
112
|
registerContextMenuHandler(command, execute) {
|
|
113
113
|
this.client.on('interactionCreate', interaction => interaction.isContextMenu() &&
|
|
114
|
-
interaction.targetType === command.type &&
|
|
114
|
+
interaction.targetType === (command.type === 2 /* USER */ ? 'USER' : 'MESSAGE') &&
|
|
115
115
|
interaction.commandName === command.name &&
|
|
116
116
|
execute(interaction, interaction.targetType === 'USER'
|
|
117
117
|
? {
|
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": "3.0.
|
|
4
|
+
"version": "3.0.4",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rimraf -rf dist && tsc -p tsconfig.json",
|
|
7
7
|
"prepublish:npm": "npm run build",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@commitlint/cli": "15.0.0",
|
|
47
47
|
"@commitlint/config-angular": "15.0.0",
|
|
48
48
|
"@favware/npm-deprecate": "^1.0.4",
|
|
49
|
-
"@nestjs/common": "8.2.
|
|
50
|
-
"@nestjs/core": "8.2.
|
|
51
|
-
"@types/node": "
|
|
49
|
+
"@nestjs/common": "8.2.4",
|
|
50
|
+
"@nestjs/core": "8.2.4",
|
|
51
|
+
"@types/node": "17.0.0",
|
|
52
52
|
"@typescript-eslint/eslint-plugin": "4.33.0",
|
|
53
53
|
"@typescript-eslint/parser": "4.33.0",
|
|
54
54
|
"discord.js": "13.3.1",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"husky": "7.0.4",
|
|
59
59
|
"prettier": "2.5.1",
|
|
60
60
|
"reflect-metadata": "0.1.13",
|
|
61
|
-
"release-it": "
|
|
61
|
+
"release-it": "14.11.8",
|
|
62
62
|
"rimraf": "3.0.2",
|
|
63
63
|
"rxjs": "7.4.0",
|
|
64
|
-
"typescript": "4.5.
|
|
64
|
+
"typescript": "4.5.4"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@nestjs/common": "^8.0.0",
|