UNPKG

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