From 6ff357d7653330166efc4d75b29cd20e5e5aacef Mon Sep 17 00:00:00 2001 From: Francesco Esposito <33671357+frab1t@users.noreply.github.com> Date: Wed, 20 Feb 2019 17:46:21 +0100 Subject: [PATCH] add position/deviceList template --- utils.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/utils.js b/utils.js index 5dbd058..36fb4c9 100644 --- a/utils.js +++ b/utils.js @@ -10,7 +10,6 @@ https://github.com/frab1t/trackmyd-bot to configure the bot. Made with ❤️ by @frab1t`; - return msg; } @@ -21,7 +20,6 @@ function templateHelp() { /list - view device available. /add - add new device. /remove - remove device.`; - return msg; } @@ -32,6 +30,26 @@ and run the bot on your local network. 😎`; return msg; } +function templatePosition(data) { + const msg = `📲 📡 ${data.name} +------------------------------------- +- 🏔️ Altitude: ${data.position.altitude} +- ⚡️ Speed: ${data.position.speed} +- 📏 Accurancy: ${data.position.accurancy} +- 🔋 Battery: ${data.information.battery} +- ⌚️ 2019-02-18T13:44:01`; + + return msg; +} + +function templateDevicesList(data) { + const msg = `📲 ${data.name} + ${data._id}`; + return msg; +} + module.exports.templateStart = templateStart; module.exports.templateHelp = templateHelp; module.exports.templateUnauthorizedUser = templateUnauthorizedUser; +module.exports.templatePosition = templatePosition; +module.exports.templateDevicesList = templateDevicesList;