mirror of
https://gitlab.com/ceda_ei/Quadnite-Bot
synced 2026-05-06 05:40:04 +02:00
Add /word, /words
This commit is contained in:
21
commands/words.js
Normal file
21
commands/words.js
Normal file
@@ -0,0 +1,21 @@
|
||||
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.";
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user