运行代码时,我不断收到SyntaxError: Unexpected identifier
。有人知道如何解决吗?
代码:
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('message', msg => {
if (msg.content === 'help') {
msg.reply('I dont want to help you now! go ask somebody else!');
}
bot.user.setStatus('available')
bot.user.setPresence({
game: {
name: Made by sorryIwonbtwYT for TheSinni',
type: "WATCHING",
}
});
});
答案 0 :(得分:0)
好像您在setPresence附近缺少一个'
这应该解决您的代码:
const Discord = require('discord.js');
const client = new Discord.Client();
client.on("ready", () => {
client.user.setPresence({ game: { name: 'Made by sorryIwonbtwYT for TheSinni', type: 'WATCHING' }, status: 'online' })
})
client.on('message', msg => {
if (msg.content === 'help') {
msg.reply('I dont want to help you now! go ask somebody else!');
}
});
client.login('YOUR_TOKEN')