Octanite-Bot/commands/words.js

22 lines
374 B
JavaScript
Raw Normal View History

2019-02-11 23:02:53 +01:00
module.exports = (random, words) => (ctx) => {
const text_array = ctx.message.text.split(" ");
if (text_array.length == 1) {
return random(words)(10);
} else {
const input = parseInt(text_array[1]);
if (input && input > 0)
if (input < 50)
return random(words)(input);
else
return "Too many words.";
else
return "Not a valid number.";
}
};