-4
最近我通过NodeJS安装了discord.js-music。在制做的命令和执行机器人,我得到这个错误:
});
^
SyntaxError: Unexpected token)<br><br>
discord.js - 一个命令中的愚蠢错误
所以,从逻辑上讲,我删除了“),”即使我知道这是必须的,我得到这个错误:
});
^
SyntaxError: Unexpected token)
我的代码是:
const Client = require('discord.js').Client;
const music = require('discord.js-music');
class Music extends patron.Command {
constructor() {
super({
names: ['play'],
groupName: 'general',
description: 'joins your voice channel and plays the requested music.',
args: [
new patron.Argument({
name: 'message',
key: 'message',
type: 'message',
example: 'https://www.youtube.com/watch?v=DArzZ3RvejU',
defaultValue: patron.ArgumentDefault.message,
remainder: true
})
]
});
};
async run(msg, args) {
if (String.isNullOrWhiteSpace(args.command)) {
await msg.reply('you didn\'t specify the URL or search for music to play.')
music(client);
}
}
我看到的两件事 - 你有一个引号括号(你的代码的倒数第二行),以及很少的右括号。因此,您需要取消引用该引用,并在最后添加另一引用。 – theGleep
@theGleep你是如何设法阅读的? ;) –
你知道错误指向的行吗?请注意,您可以在编辑问题时用{}按钮格式化代码块,现在有点奇怪地格式化了。我假设两个
标签不是错误消息的一部分? – Confuzing