2023-02-01 12:04:14 +01:00
|
|
|
const command = {
|
|
|
|
name: "pyramid",
|
2023-02-01 12:41:57 +01:00
|
|
|
desc: "make a pyramid (this blocks the thread and no other command will execute until it's done)",
|
2023-02-02 23:37:42 +01:00
|
|
|
restricted: true,
|
2023-02-02 23:58:58 +01:00
|
|
|
mod: true,
|
2023-02-01 12:04:14 +01:00
|
|
|
run: async (client, msg, splitted) => {
|
2023-02-01 12:41:57 +01:00
|
|
|
if (
|
|
|
|
isNaN(splitted[2]) ||
|
|
|
|
splitted[2] === undefined ||
|
2023-02-01 17:51:31 +01:00
|
|
|
splitted[3] === undefined ||
|
|
|
|
parseInt(splitted[2]) > 50
|
2023-02-01 12:41:57 +01:00
|
|
|
) {
|
2023-02-11 13:48:05 +01:00
|
|
|
await client.say(
|
2023-02-01 12:04:14 +01:00
|
|
|
msg.channelName,
|
|
|
|
`${msg.displayName}, Second arg needs to be a valid number and third arg needs to exist PoroSad`
|
|
|
|
);
|
2023-02-01 12:41:57 +01:00
|
|
|
|
|
|
|
return;
|
2023-02-01 12:04:14 +01:00
|
|
|
}
|
|
|
|
let arr = [];
|
|
|
|
for (let i = 0; i < parseInt(splitted[2]); i++) {
|
|
|
|
arr.push(splitted.slice(3).join(" "));
|
2023-02-11 13:48:05 +01:00
|
|
|
client.say(msg.channelName, arr.join(" "));
|
2023-02-01 12:04:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
for (let i = parseInt(splitted[2]); i > 1; i--) {
|
|
|
|
arr.pop();
|
2023-02-11 13:48:05 +01:00
|
|
|
client.say(msg.channelName, arr.join(" "));
|
2023-02-01 12:04:14 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2023-02-01 22:11:48 +01:00
|
|
|
module.exports = { command };
|