trackmyd-bot/utils.js

58 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-02-19 14:47:31 +01:00
const config = require('./config');
// template
function templateStart() {
const msg = `* Welcome to ${config.app.name} 📱📡*\n
A bot to track your devices with GPS.
Please, read the README on
https://github.com/frab1t/trackmyd-bot
to configure the bot.
Made with by @frab1t`;
return msg;
}
function templateHelp() {
const msg = `📃 * ${config.app.name} commands*: \n
/help - view commands.
/position - view device's position.
/list - view device available.
/add - add new device.
/remove - remove device.`;
return msg;
}
function templateUnauthorizedUser() {
const msg = `Unauthorized user. 🤖 \n
2019-02-19 14:56:38 +01:00
Clone the repository https://github.com/frab1t/trackmyd-bot
2019-02-19 14:47:31 +01:00
and run the bot on your local network. 😎`;
return msg;
}
2019-02-20 17:46:21 +01:00
function templatePosition(data) {
2019-02-21 12:58:28 +01:00
const msg = `📲 📡 *${data.name}*
🏔 _Altitude_: *${data.position.altitude} m.*
_Speed_: *${data.position.speed} m/h*
📏 _Accurancy_: *${data.position.accurancy} m.*
🔋 _Battery_: *${data.information.battery}%*
2019-02-18T13:44:01`;
2019-02-20 17:46:21 +01:00
return msg;
}
function templateDevicesList(data) {
2019-02-21 12:58:28 +01:00
const msg = `📲 *${data.name}*
----
2019-02-20 17:46:21 +01:00
${data._id}`;
return msg;
}
2019-02-19 14:47:31 +01:00
module.exports.templateStart = templateStart;
module.exports.templateHelp = templateHelp;
module.exports.templateUnauthorizedUser = templateUnauthorizedUser;
2019-02-20 17:46:21 +01:00
module.exports.templatePosition = templatePosition;
module.exports.templateDevicesList = templateDevicesList;