UNPKG

@necord/schematics

Version:

A collection of schematics for Necord projects with NestJS

27 lines (26 loc) 904 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.command = command; const common_1 = require("../common"); const command_type_enum_1 = require("./command-type.enum"); class CommandSchematicFactory extends common_1.CommonSchematicFactory { constructor() { super(...arguments); this.type = 'command'; } generate(options) { switch (options.strategy) { case command_type_enum_1.CommandType.TEXT_COMMAND: this.templatePath = './files/text-command'; break; case command_type_enum_1.CommandType.SLASH_COMMAND: this.templatePath = './files/slash-command'; break; } return super.generate(options); } } function command(options) { const commandFactory = new CommandSchematicFactory(); return commandFactory.create(options); }