From 6023bc9cf988d91e3b01241ef9710972d998c0e6 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Wed, 21 Aug 2024 07:14:10 -0600 Subject: [PATCH] Fix that --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 122c124..b797cd4 100644 --- a/index.js +++ b/index.js @@ -92,7 +92,7 @@ function sendDemo(accountNumber, transaction, placeName, systemName, zoneNumber, // Check if the account exists and is verified // Account exists and is verified // Send the alert - runCommand(process.env.TTS_COMMAND.replace("%s", transaction), `Hello. This is an automated call from KCA SecuriNet Monitoring. ${systemName} has reported a ${event}, ZONE ${zoneNumber}, ${zoneName}, at ${placeName}`).then((output) => { + runCommand(process.env.TTS_COMMAND.replace("%s", `${transaction}.wav`), `Hello. This is an automated call from KCA SecuriNet Monitoring. ${systemName} has reported a ${event}, ZONE ${zoneNumber}, ${zoneName}, at ${placeName}`).then((output) => { runCommand(`ffmpeg -y -i /tmp/${transaction}.wav -ar 8000 -ac 1 -c:a pcm_s16le /tmp/${transaction}-alert.wav`).then(() => { runCommand(`rm /tmp/${transaction}.wav`) // strip extension from filename @@ -138,7 +138,7 @@ function sendAlert(accountNumber, transaction, placeName, systemName, zoneNumber } else if (row) { // Account exists and is verified // Send the alert - runCommand(process.env.TTS_COMMAND.replace("%s", transaction), `Hello. This is an automated call from KCA SecuriNet Monitoring. ${systemName} has reported a ${event}, ZONE ${zoneNumber}, ${zoneName}, at ${placeName}`).then((output) => { + runCommand(process.env.TTS_COMMAND.replace("%s", `${transaction}.wav`), `Hello. This is an automated call from KCA SecuriNet Monitoring. ${systemName} has reported a ${event}, ZONE ${zoneNumber}, ${zoneName}, at ${placeName}`).then((output) => { runCommand(`ffmpeg -y -i /tmp/${transaction}.wav -ar 8000 -ac 1 -c:a pcm_s16le /tmp/${transaction}-alert.wav`).then(() => { runCommand(`rm /tmp/${transaction}.wav`) // strip extension from filename @@ -253,7 +253,7 @@ function sendVerificationCode(account) { console.error(err); } else if (row) { // Send verification code to phone number - runCommand(process.env.TTS_COMMAND.replace("%s", transaction), `Hello. This is an automated call from KCA SecuriNet Monitoring. To verify your phone number, use the slash verify command on Discord. Your verification code is ${row.verification_code.split("").join(", ")}. Repeating, your code is ${row.verification_code.split("").join(", ")}. Once again, your code is ${row.verification_code.split("").join(", ")}`).then((output) => { + runCommand(process.env.TTS_COMMAND.replace("%s", `${account}-code.wav`), `Hello. This is an automated call from KCA SecuriNet Monitoring. To verify your phone number, use the slash verify command on Discord. Your verification code is ${row.verification_code.split("").join(", ")}. Repeating, your code is ${row.verification_code.split("").join(", ")}. Once again, your code is ${row.verification_code.split("").join(", ")}`).then((output) => { runCommand(`ffmpeg -y -i /tmp/${account}-code.wav -ar 8000 -ac 1 -c:a pcm_s16le /tmp/${account}-verification.wav`).then(() => { runCommand(`rm /tmp/${account}-code.wav`) // strip extension from filename