我一直试图让这个机器人工作一段时间 . 我不是编码员,我对该主题有大约.002%的知识 . 有些功能可以使用,但是在添加点时它根本不起作用 .

全面披露!!!!这不是我的机器人 . 我找到了Here.

function housePointsFunc(args) {
    var house = this,

        user = args.message.member,
        roles = user.roles,

        canGivePoints = false,
        canTakePoints = false,
        canSetPoints = false;

    roles.map((value, index, arr) => {
        for (let i = 0; i < config.roles.doAllOfTheAbove.length; i++) {
            if (config.roles.doAllOfTheAbove[i] === value.name.toLowerCase()) {
                canGivePoints = true;
                canTakePoints = true;
                canSetPoints = true;
            }
        }

        
        if (!canTakePoints) {
            for (let i = 0; i < config.roles.takePoints.length; i++) {
                if (config.roles.takePoints[i] === value.name.toLowerCase()) {
                    canTakePoints = true;
                    break;
                }
            }
        }

        if (!canGivePoints) {
            for (let i = 0; i < config.roles.givePoints.length; i++) {
                if (config.roles.givePoints[i] === value.name.toLowerCase()) {
                    canGivePoints = true;
                    break;
                }
            }
        }

        if (!canSetPoints) {
            for (let i = 0; i < config.roles.setPoints.length; i++) {
                if (config.roles.setPoints[i] === value.name.toLowerCase()) {
                    canSetPoints = true;
                    break;
                }
            }
        }
    });

    var firstParam = args.params[0];
    if (firstParam !== undefined) {
        if (firstParam.toLowerCase !== undefined) {
            firstParam = firstParam.toLowerCase();
        }
    }

    if (firstParam === 'points' || firstParam === 'point' || firstParam === 'p' || firstParam === undefined) {
        args.send(house.capitalize() + ' has ' + points[house] + ' point(s)!');
    } else if ((firstParam === 'add' || firstParam === 'increase' || firstParam === '+' || firstParam === 'give') && canGivePoints === true) {
        if (isNaN(args.params[1]) || args.params[1] === 'Infinity' || args.params[1] === '-Infinity') {
            args.send(' ' + args.params[1] + ' is not a number!');
        } else {
            points[house] += Number(args.params[1]);
            if (points[house] < 0) {
                points[house] = 0;
            }
            args.send('Added ' + args.params[1] + ' point(s) to ' + house.capitalize() + '!\n' + house.capitalize() + ' has ' + points[house] + ' point(s) now!');
            writeJSON(__dirname + '/JSON/points.json', points);
        }
    } else if ((firstParam === 'subtract' || firstParam === 'sub' || firstParam === 'decrease' || firstParam === '-' || firstParam === 'take') && canTakePoints === true) {
        if (isNaN(args.params[1]) || args.params[1] === 'Infinity' || args.params[1] === '-Infinity') {
            args.send(' ' + args.params[1] + ' is not a number!');
        } else {
            points[house] -= Number(args.params[1]);
            if (points[house] < 0) {
                points[house] = 0;
            }
            args.send('Subtracted ' + args.params[1] + ' point(s) from ' + house.capitalize() + '!\n' + house.capitalize() + ' has ' + points[house] + ' point(s) now!');
            writeJSON(__dirname + '/JSON/points.json', points);
        }
    } else if ((firstParam === 'set' || firstParam === 'setas') && canSetPoints === true) {
        if (isNaN(args.params[1]) || args.params[1] === 'Infinity' || args.params[1] === '-Infinity') {
            args.send(' ' + args.params[1] + ' is not a number!');
        } else {
            points[house] = Number(args.params[1]);
            if (points[house] < 0) {
                points[house] = 0;
            }
            args.send('Set ' + house.capitalize() + " house's points to " + args.params[1] + '!\n' + house.capitalize() + ' has ' + points[house] + ' point(s) now!');
            writeJSON(__dirname + '/JSON/points.json', points);
        }

这是我遇到问题的一点代码 . (或者至少我认为是 . )

我也一直试图弄清楚如何将这个机器人的功能限制在某些角色,但那是另一天!哈哈 . 谁能看到这里有什么问题?这是我缺少的东西吗?

哦,是的,我试图找到创建者的联系信息,但我无法在任何地方找到它 . -叹-

任何帮助将不胜感激 .

谢谢,Razzi