【发布时间】:2018-12-09 04:33:26
【问题描述】:
我正在制作一个不和谐的机器人,我正在尝试制作一个计时器,它每秒将消息编辑为时间 + 1 秒,就像一个真正的时钟(如 0:00)。我是这方面的菜鸟。这是我的脚本:
const Discord = require("discord.js");
exports.run = async(bot, message, args) => {
let timerMessage = await message.channel.send('0');
for (i = 0, 10000000000) {
setTimeout(function() {
timerMessage.edit(timerMessage + 1);
}, 1000);
}
}
module.exports.help = {
name: "timer"
}
我有一个错误,它说:“解析错误:意外的令牌)” 如果您能帮我解决我的问题,我将不胜感激,谢谢!
(顺便说一句,我在 Google Chrome 上的 Glitch 中使用它)
【问题讨论】:
标签: scripting discord.js