Professor-Redwood-Team / Professor-Redwood

Pokemon Go Discord Bot
MIT License
34 stars 21 forks source link

Ignore !commands which aren't valid on the bot #49

Closed pbk01 closed 6 years ago

pbk01 commented 6 years ago

This bot should completely ignore any !command which does not work with the bot.

Many bots use commands which start with "!" (e.g. !clear (Mee6Bot), !setup, etc). This bot currently returns a response ("_, you may only run this command in the #professorredwood channel") for any !command.

My workaround, which obsoletes the errorMessage handling at the end of client.js: constants.js:

const data = {
    COMMANDS: ['breakpoint', 'checknew', 'egg', 'help', 'hide', 'mod', 'play', 'raid',
         'reset', 'team', 'want', 'wild']

client.js:

    //Ignore any !commands not listed in the CONSTANT.COMMANDS list
    if (CONSTANTS.COMMANDS.indexOf(command.slice(1)) <= -1) {
        return;
    }