src/message-processor.js
/**
   *
   * @param {Object} msg message object received from API
   */
@param {Object} msg message object received from API
@param { Object } msg message object received from API
processCommand (msg) {
    const reactionToCommand = this.commandProcessor.getReactionToCommand(msg);
    switch (typeof reactionToCommand) {
      case 'function':
        const reactionResult = reactionToCommand(msg);
        if (typeof reactionResult === 'string') {
          this.sendMessage(msg.chat.id, reactionResult);
        }
        break;
      case 'string':
        this.sendMessage(msg.chat.id, reactionToCommand);
        break;
      default:
        break;
    }
  }
processCommand ( msg ) { const reactionToCommand = this . commandProcessor . getReactionToCommand ( msg ) ; switch ( typeof reactionToCommand ) { case 'function' : const reactionResult = reactionToCommand ( msg ) ; if ( typeof reactionResult === 'string' ) { this . sendMessage ( msg . chat . id , reactionResult ) ; } break ; case 'string' : this . sendMessage ( msg . chat . id , reactionToCommand ) ; break ; default : break ; } }
@param {Object} msg message object received from API
@param { Object } msg message object received from API
//console.log('No reaction, seems like command is restricted');