diff --git a/src/server.js b/src/server.js index 2686e92..8bd0ed4 100644 --- a/src/server.js +++ b/src/server.js @@ -122,10 +122,19 @@ async function processor(group, consumer, streamKey) { for (const stream of res) { for (const msg of stream.messages) { + if (msg.message.device_id !== config.DEVICE_ID) { + continue + } + console.log(`[${consumer}] Processing:`, msg); - if (msg.message.command === "play_music") { - await playAudio("Playing music."); + switch (msg.message.command) { + case "greeting": + await playAudio("Hello! I am the Many Tailed Fox."); + break; + + default: + await playAudio("Command, " + String(msg.message.command) + " is undefined.") } await redis.client.xAck(streamKey, group, msg.id);