javascript - Discord Bot Timer 说有效的东西不是,有没有办法解决这个问题?
问题描述
我做了一个计时器命令,但是当我输入一个有效时间它说它无效时会发生什么,有人可以帮助我吗?
bot.on('message', message => {
let args = message.content.substring(PREFIX.length).split(" ");
switch (args[0]) {
case 'timer':
let time = (args[1]);
if(!time){
return message.reply("You didn't specify a time!");
}
message.reply(`Your timer has started for ${ms(ms(time))}`);
setTimeout(function(){
message.reply(`your timer has stopped`)
}, ms(time));
if (isNaN(time)) return message.reply('That is not a valid number');
}
});
解决方案
推荐阅读
- ssh - Nifi ExecuteProcess 处理器中的错误 - 主机密钥验证失败
- excel - 在 Excel 2016 中加快 VBA 搜索
- regex - 正则表达式仅匹配一次出现后跟两位数字
- javascript - 点击状态;表单控件组的样式
- xpath - Xpath 使用 substring-after 去除文本
- jquery - 选择由 ajax 填充的列表在第一次单击时未打开所有选项
- css - 使用 react styled-components 全局应用引导主题
- object - 从树形菜单上的对象返回子级别值 - quasar 框架
- google-apps-script - google-apps-script:事件触发器上没有“源”字段
- windows - 如何在 PowerShell 中使用 Set-ADUser 使用十六进制设置 msExchArchiveGUID 的用户属性?