Snips is not responding

I am working with the matrix creator and following these tutorials
Matrix Creator Snips Installation
Voice Control Your Lights with Snips.ai and a MATRIX Device!
yet whenever I run the assistant.js file, snips does not pick up the wakeword. Please help.
Here’s my code so far (keep in mind I have changed some of the functions as I had changed the intent of the assistant). The assistant is meant to work like a thermostat.
///////////////////////////////
var mqtt = require(‘mqtt’);
var client = mqtt.connect(‘mqtt://localhost’,{port:1883});
var relay = require(’./relay.js’);
var everloop = require(’./everloop.js’);
var snipsUsername = ‘alexisCruz’;
var wakeword = ‘hermes/hotword/default/detected’;
var sessionEnd = ‘hermes/dialogueManager/sessionEnded’;
var thermostate = ‘hermes/intent/alexisCruz:lightstate’;

client.on(‘connect’, function(){
console.log(‘Connected to snips mqtt server\n’);
client.subscribe(‘hermes/hotword/default/detected’);
client.subscribe(‘hermes/dialogueManager/sessionEnded’);
client.subscribe(‘hermes/intent/alexisCruz:lightstate’);
});

client.on(‘message’, function(topic,message){
var message = JSON.parse(message);
if(topic == wakeword){
everloop.startWaiting();
console.log(‘Wakeword Detected’);
}
else if(topic == thermostate){
try{
if(message.slots[0].value.value === ‘raise’ && message.slots[1].value.kind === ‘Number’)
{
//relay.makeTemp(message.slots[1].value.value);
everloop.stopWaiting();
console.log(‘thermos on’);
}
else if(message.slots[0].value.value === ‘cool’ && message.slots[1].value.kind === ‘Number’)
{
//relay.makeTemp(message.slots[1].value.value);
everloop.stopWaiting();
console.log(‘thermos on’);
}
else if (message.slots[0].value.value === ‘raise’ ){//&& message.slots[0].value.kind === ‘custom’){
//relay.raiseTempBy2();
everloop.stopWaiting();
console.log(‘thermos on’);
}
else if(message.slots[0].value.value === ‘cool’)//&& message.slots[0].value.kind === ‘custom’)
{
//relay.lowerTempBy2();
everloop.stopWaiting();
console.log(‘thermos on’);
}
else if(message.slots[0].value.value === ‘read’)
{
//relay.readTemp();
everloop.stopWaiting();
console.log(‘thermos on’);
}
else if(message.slots[0].value.value === ‘set’ && message.slots[1].value.kind === ‘Number’)
{
//relay.makeTemp(message.slots[1].value.value);
everloop.stopWaiting();
console.log(‘thermos on’);
}
else{
//relay.lightsOff();
everloop.stopWaiting();
console.log(‘thermos off’);
}
}
catch(e){
console.log(‘didn’t receive on or off state’);
}
}
else if(topic == sessionEnd){
everloop.stopWaiting();
console.log(‘session ended\n’);
}
});

Use code format please, easier to read

This is fixed. You’re welcome