src/main.js
function parseMessage(message) {
  const parts = message.content.split(' ');
  const command = parts[1];
  const args = parts.slice(2);

  if (typeof Commands[command] === 'function') {
    // @TODO We could check the command validity here
    return { command, args };
  } else {
    return null;
  }
}
function parseMessage(message) {
  const parts = message.content.split(' ');
  const command = parts[1];
  const args = parts.slice(2);

  if (typeof Commands[command] === 'function') {
    // @TODO We could check the command validity here
    return { command, args };
  } else {
    return null;
  }
}
function parseMessage ( message ) { const parts = message . content . split ( ' ' ) ; const command = parts [ 1 ] ; const args = parts . slice ( 2 ) ; if ( typeof Commands [ command ] === 'function' ) { // @TODO We could check the command validity here return { command , args } ; } else { return null ; } }
Take in the content of a message and return a command
@param  {Message} message The Discord.Message object
@return {Object}          An object continaing a command name and arguments
Take in the content of a message and return a command