discord.js - 一个命令中的愚蠢错误

discord.js - Stupid errors in one command

最近我通过 NodeJS 安装了 discord.js-music。发出命令并执行机器人后,我收到此错误:

});
 ^

SyntaxError: Unexpected token )

所以,从逻辑上讲,我删除了“)”,即使我知道它是必需的,但我得到了这个错误:

});
 ^

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);

        }
    }

检查你的代码,在异步 运行 函数部分的第二部分缺少右花括号 }。