!赞扬
所有其他命令都正确运行(下面我放了一个这样的命令,
!救世主
,例如),但是
!赞扬
我希望它能在循环中迭代,每次都发送一条消息,就像你从一个
for
环
bot.on('message', function(user, userID, channelID, message, evt) {
if (message.substring(0, 1) === '!') {
let args = message.substring(1).split(' ');
let cmd = args[0];
args = args.splice(1);
switch (cmd) {
case 'saviour':
bot.sendMessage({
to: channelID,
message: 'Our current lord and saviour is named asghjahero'
});
break; //the above case works fine
case 'praise':
for (let i = 1; i === 5; i++) {
bot.sendMessage({
to: channelID,
message: 'All Hail!'
});
}
break;
}
}
});