Wazarr94 / haxball_bot_headless

Ready-to-go scripts and functions for the HaxBall Headless API !
MIT License
46 stars 74 forks source link

problem #33

Closed byoxygen closed 2 years ago

byoxygen commented 2 years ago

Hi @Wazarr94. How can ban to players from DC?

Could you prepare this feature and share?

And I also need another feature for DC.

             if (scores.red > scores.blue) {
                embeds.color('14958399');
            } else {
                embeds.color('9567999');
            }

Please tell me how to put that's commands?

Wazarr94 commented 2 years ago

Banning a player from Discord is not something achievable with what I'm doing. It requires a Discord bot, which is something too technical for people to run.

For the second question, it's pretty simple. In the fetchSummaryEmbed function, change this code:

var win = (game.scores.red > game.scores.blue) * 1 + (game.scores.blue > game.scores.red) * 2;
var objectBodyWebhook = {
        embeds: [
            {
                title: `📝 MATCH REPORT #${getIdReport()}`,
                description:
                    `**${getTimeEmbed(game.scores.time)}** ` +
                    (win == 1 ? '**Red Team** ' : 'Red Team ') + game.scores.red +
                    ' - ' +
                    game.scores.blue + (win == 2 ? ' **Blue Team**' : ' Blue Team') +
                    '\n```c\nPossession: ' + possRString + '% - ' + possBString + '%' +
                    '\nAction Zone: ' + zoneRString + '% - ' + zoneBString + '%\n```\n\n',
                color: 9567999,
                fields: fields,
                footer: {
                    text: `Recording: ${getRecordingName(game)}`,
                },
                timestamp: new Date().toISOString(),
            },
        ],
        username: roomName
    };

to this code:

var win = (game.scores.red > game.scores.blue) * 1 + (game.scores.blue > game.scores.red) * 2;
let embedColor = win == 1 ? 14958399: 9567999;
var objectBodyWebhook = {
    embeds: [
        {
            title: `📝 MATCH REPORT #${getIdReport()}`,
            description:
                `**${getTimeEmbed(game.scores.time)}** ` +
                (win == 1 ? '**Red Team** ' : 'Red Team ') + game.scores.red +
                ' - ' +
                game.scores.blue + (win == 2 ? ' **Blue Team**' : ' Blue Team') +
                '\n```c\nPossession: ' + possRString + '% - ' + possBString + '%' +
                '\nAction Zone: ' + zoneRString + '% - ' + zoneBString + '%\n```\n\n',
            color: embedColor,
            fields: fields,
            footer: {
                text: `Recording: ${getRecordingName(game)}`,
            },
            timestamp: new Date().toISOString(),
        },
    ],
    username: roomName
};