AgustinSRG / Pokemon-Showdown-Node-Bot

Pokemon Showdown Bot for Node (Deprecated)
Other
34 stars 150 forks source link

Add command to configure the leaderboards system with ease #40

Closed Champ1604 closed 8 years ago

Champ1604 commented 8 years ago

Hey! This bot is extremely cool but recently I came with an error related to the leaderboard system. Because of this, I can't enable leaderboards for any room, as it shows some unknown error. Screenshot of the place where I wrote the code in config.js. Screenshot of the error in Terminal.

I would appreciate any help as I need this bot for my server. Thanks. Regards, ~Champ1604

Ecuacion commented 8 years ago

The crash is in your personal config.js file, it's not a bug or a laderboards system error.

Make sure exports.leaderboards = {}; is defined. If not, add it at the beginning of the file. Then you can add the config data for the rooms. Example:

exports.leaderboards = {};

exports.leaderboards['tournaments'] = {
    winnerPoints: 5,
    finalistPoints: 3,
    semiFinalistPoints: 1,
    battlePoints: 0,
    onlyOfficial: true
};

exports.leaderboards['lobby'] = {
    winnerPoints: 5,
    finalistPoints: 3,
    semiFinalistPoints: 1,
    battlePoints: 0,
    onlyOfficial: true
};

Anyway i planned to add commands to configure the laderboards system to avoid this kinds of problems.