necord 4.3.0 → 4.3.3
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/README.md
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>
|
|
3
|
+
<a href="#"><img src="https://necord.org/img/logo.png" alt ="Necord Logo"></a>
|
|
4
|
+
</h1>
|
|
5
|
+
🤖 A module for creating <b><a href="https://discord.com/">Discord</a> bots</b> using <a href="https://nestjs.com">NestJS</a>, based on <a href="https://discord.js.org/">Discord.js</a>
|
|
6
|
+
<br/><br/>
|
|
7
|
+
<a href="https://necord.org">Documentation ✨</a>   <a href="https://github.com/necordjs/necord">Source code 🪡</a>   <a href="https://github.com/necordjs/samples">Examples 🛠️</a>   <a href="https://www.npmjs.com/package/necord">NPM 🚀</a>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
4
10
|
|
|
5
|
-
<p align="center">
|
|
6
|
-
A module for creating Discord bots using <a href="https://nestjs.com/" target="_blank">NestJS</a>, based on <a href="https://discord.js.org/#/" target="_blank">Discord.js</a>.
|
|
7
|
-
</p>
|
|
8
11
|
|
|
9
|
-
<p align="center">
|
|
10
|
-
<a href='https://img.shields.io/npm/v/necord'><img src="https://img.shields.io/npm/v/necord" alt="NPM Version" /></a>
|
|
11
|
-
<a href='https://img.shields.io/npm/l/necord'><img src="https://img.shields.io/npm/l/necord" alt="NPM License" /></a>
|
|
12
|
-
<a href='https://img.shields.io/npm/dm/necord'><img src="https://img.shields.io/npm/dm/necord" alt="NPM Downloads" /></a>
|
|
13
|
-
<a href='https://img.shields.io/github/last-commit/SocketSomeone/necord'><img src="https://img.shields.io/github/last-commit/SocketSomeone/necord" alt="Last commit" /></a>
|
|
14
|
-
</p>
|
|
15
12
|
|
|
16
13
|
## About
|
|
17
14
|
|
|
@@ -27,7 +24,7 @@ This module provides fast and easy way for creating Discord bots and deep integr
|
|
|
27
24
|
- Full support of NestJS guards, interceptors, filters and pipes!
|
|
28
25
|
|
|
29
26
|
For questions and support please use
|
|
30
|
-
the [Issues](https://github.com/
|
|
27
|
+
the [Issues](https://github.com/necordjs/necord/issues/new?assignees=&labels=question&template=question.yml).
|
|
31
28
|
|
|
32
29
|
## Installation
|
|
33
30
|
|
|
@@ -91,7 +88,7 @@ Whenever you need to handle any event data, use the `Context` decorator.
|
|
|
91
88
|
|
|
92
89
|
If you want to fully dive into Necord check out these resources:
|
|
93
90
|
|
|
94
|
-
* [Necord Wiki](https://
|
|
91
|
+
* [Necord Wiki](https://necord.org) - Official documentation of Necord.
|
|
95
92
|
* [Nest JS](https://docs.nestjs.com) - A progressive framework for creating well-architectured applications.
|
|
96
93
|
* [Discord JS](https://discord.js.org) - The most powerful library for creating bots.
|
|
97
94
|
* [Discord API](https://discord.com/developers/docs) - Official documentation of Discord API.
|
|
@@ -103,4 +100,4 @@ If you want to fully dive into Necord check out these resources:
|
|
|
103
100
|
|
|
104
101
|
## License
|
|
105
102
|
|
|
106
|
-
[MIT](https://github.com/
|
|
103
|
+
[MIT](https://github.com/necordjs/necord/blob/master/LICENSE) © [Alexey Filippov](https://github.com/SocketSomeone)
|
|
@@ -14,10 +14,12 @@ exports.MentionableOption = createNecordOptionDecorator('MENTIONABLE', 'getMenti
|
|
|
14
14
|
exports.AttachmentOption = createNecordOptionDecorator('ATTACHMENT', 'getAttachment');
|
|
15
15
|
function createNecordOptionDecorator(type, methodName) {
|
|
16
16
|
return (data) => (target, propertyKey) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
Reflect.defineProperty(target, propertyKey, {
|
|
18
|
+
value: undefined,
|
|
19
|
+
writable: true,
|
|
20
|
+
configurable: true
|
|
21
|
+
});
|
|
22
|
+
Reflect.defineMetadata(necord_constants_1.OPTIONS_METADATA, Object.assign(Object.assign({}, data), { type,
|
|
23
|
+
methodName }), target, propertyKey);
|
|
22
24
|
};
|
|
23
25
|
}
|
|
@@ -7,9 +7,21 @@ const params_util_1 = require("./params.util");
|
|
|
7
7
|
exports.Context = (0, params_util_1.createNecordParamDecorator)(context_1.NecordParamType.CONTEXT);
|
|
8
8
|
exports.Options = (0, params_util_1.createNecordPipesParamDecorator)(context_1.NecordParamType.OPTIONS, [
|
|
9
9
|
(target, propertyKey, parameterIndex) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
try {
|
|
11
|
+
const paramTypes = Reflect.getMetadata('design:paramtypes', target, propertyKey);
|
|
12
|
+
let prototype = Reflect.getPrototypeOf(new paramTypes[parameterIndex]());
|
|
13
|
+
const options = {};
|
|
14
|
+
for (; prototype !== Object.prototype; prototype = Reflect.getPrototypeOf(prototype)) {
|
|
15
|
+
Object.getOwnPropertyNames(prototype)
|
|
16
|
+
.map(name => [name, Reflect.getMetadata(necord_constants_1.OPTIONS_METADATA, prototype, name)])
|
|
17
|
+
.filter(([, meta]) => !!meta)
|
|
18
|
+
.forEach(([name, meta]) => { var _a; return ((_a = options[name]) !== null && _a !== void 0 ? _a : (options[name] = meta)); });
|
|
19
|
+
}
|
|
20
|
+
Reflect.defineMetadata(necord_constants_1.OPTIONS_METADATA, options, target[propertyKey]);
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
// NO-OP
|
|
24
|
+
}
|
|
13
25
|
}
|
|
14
26
|
]);
|
|
15
27
|
exports.Info = (0, params_util_1.createNecordPipesParamDecorator)(context_1.NecordParamType.INFO);
|
|
@@ -62,7 +62,7 @@ let NecordInteractionUpdate = NecordInteractionUpdate_1 = class NecordInteractio
|
|
|
62
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
63
|
if (interaction.isModalSubmit()) {
|
|
64
64
|
return (_a = this.registry
|
|
65
|
-
.getModal(interaction.customId)) === null || _a === void 0 ? void 0 : _a.metadata.execute(interaction, null, { type: context_1.NecordInfoType.MODAL });
|
|
65
|
+
.getModal(interaction.customId)) === null || _a === void 0 ? void 0 : _a.metadata.execute([interaction], null, { type: context_1.NecordInfoType.MODAL });
|
|
66
66
|
}
|
|
67
67
|
if (interaction.isMessageComponent()) {
|
|
68
68
|
return (_b = this.registry
|
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.3.
|
|
4
|
+
"version": "4.3.3",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rimraf -rf dist && tsc -p tsconfig.json",
|
|
7
7
|
"prepublish:npm": "npm run build",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"homepage": "https://necord.org",
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|
|
37
|
-
"url": "https://github.com/
|
|
37
|
+
"url": "https://github.com/necordjs/necord"
|
|
38
38
|
},
|
|
39
39
|
"bugs": {
|
|
40
|
-
"url": "https://github.com/
|
|
40
|
+
"url": "https://github.com/necordjs/necord/issues"
|
|
41
41
|
},
|
|
42
42
|
"author": "Alexey Filippov <socket.someone@gmail.com>",
|
|
43
43
|
"contributors": [
|