fix cloop error with interval 0

This commit is contained in:
ChomeNS 2022-10-24 15:03:18 +07:00
parent f4dc1fea16
commit 32bbbb08d5

View file

@ -66,7 +66,7 @@ module.exports = {
if (args[1]==='add') {
if (args[0]===bot.hash) {
if (args[3]) {
if (!Number(args[2])) throw new SyntaxError('Invalid interval');
if (!Number(args[2]) && Number(args[2]) !== 0) throw new SyntaxError('Invalid interval');
add(args.slice(3).join(' '), args[2], bot);
bot.core.run('minecraft:tellraw @a ' + JSON.stringify([{text: 'Added command ', color: 'white'}, {text: `${args.slice(3).join(' ')}`, color: 'aqua'}, {text: ' with interval ', color: 'white'}, {text: `${args[2]}`, color: 'green'}, {text: ' to the cloops', color: 'white'}]));
}