@necord/schematics 1.1.18 → 1.2.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.
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { Context, MessageCommand, MessageCommandContext, TargetMessage } from 'necord';
|
|
3
|
+
import { Message } from 'discord.js';
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class <%= classify(name) %>Commands {
|
|
7
|
+
@MessageCommand({ name: '<%= name.toLowerCase() %>' })
|
|
8
|
+
public async copyMessage(
|
|
9
|
+
@Context() [interaction]: MessageCommandContext,
|
|
10
|
+
@TargetMessage() message: Message
|
|
11
|
+
) {
|
|
12
|
+
return interaction.reply({ content: message.content });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.contextMenu = void 0;
|
|
4
4
|
const common_1 = require("../common");
|
|
5
5
|
const context_menu_type_enum_1 = require("./context-menu-type.enum");
|
|
6
|
-
const path = require("path");
|
|
7
6
|
class ContextMenuSchematicFactory extends common_1.CommonSchematicFactory {
|
|
8
7
|
constructor() {
|
|
9
8
|
super(...arguments);
|
|
@@ -12,10 +11,10 @@ class ContextMenuSchematicFactory extends common_1.CommonSchematicFactory {
|
|
|
12
11
|
generate(options) {
|
|
13
12
|
switch (options['context-menu-type']) {
|
|
14
13
|
case context_menu_type_enum_1.ContextMenuType.Message:
|
|
15
|
-
this.templatePath =
|
|
14
|
+
this.templatePath = './files/message-menu';
|
|
16
15
|
break;
|
|
17
16
|
case context_menu_type_enum_1.ContextMenuType.User:
|
|
18
|
-
this.templatePath =
|
|
17
|
+
this.templatePath = './files/user-menu';
|
|
19
18
|
break;
|
|
20
19
|
}
|
|
21
20
|
return super.generate(options);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@necord/schematics",
|
|
3
3
|
"description": "A collection of schematics for Necord projects with NestJS",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rimraf -rf dist && tsc -p tsconfig.json",
|
|
7
7
|
"postbuild": "npm run copy:collection && npm run copy:lib",
|