UNPKG

1.09 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.IonitronCommand = void 0;
4const command_1 = require("../lib/command");
5class IonitronCommand extends command_1.Command {
6 async getMetadata() {
7 return {
8 name: 'ionitron',
9 type: 'global',
10 summary: 'Print random ionitron messages',
11 options: [
12 {
13 name: 'es',
14 summary: 'Print in spanish',
15 type: Boolean,
16 },
17 ],
18 groups: ["hidden" /* HIDDEN */],
19 };
20 }
21 async run(inputs, options) {
22 const { getIonitronString, ionitronStatements } = await Promise.resolve().then(() => require('../lib/ionitron'));
23 const locale = options['es'] ? 'es' : 'en';
24 const localeStatements = ionitronStatements[locale];
25 const statement = localeStatements[Math.floor(Math.random() * (localeStatements.length))];
26 this.env.log.rawmsg(getIonitronString(statement));
27 }
28}
29exports.IonitronCommand = IonitronCommand;