const fs = require('fs') const subs = JSON.parse(fs.readFileSync('./data/group/subs.json', 'utf8')) module.exports = { prices: (bot, msg, logger) => { const subPrice = "- subscription prices"; if (msg.text && msg.text.toString().toLowerCase() === subPrice) { logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " Got subscription Prices"); bot.sendMessage(msg.chat.id, `${subs[0].SUB} ----£${subs[0].COST} ${subs[1].SUB} --------------------£${subs[1].COST} ${subs[2].SUB} -----£${subs[2].COST} ${subs[3].SUB} ---------£${subs[3].COST} ${subs[4].SUB} -------------------£${subs[4].COST} ${subs[5].SUB} ------------------£${subs[5].COST} ${subs[6].SUB} -----------£${subs[6].COST} ${subs[7].SUB} --------------£${subs[7].COST} ${subs[8].SUB} ------------------£${subs[8].COST} `) .then(() => { return bot.sendMessage(msg.chat.id, "All of these prices are for 12 Month subscription subs").then(() => { return bot.sendMessage(msg.chat.id, "Keep an eye out though because we offer special deals on different subs from time to time.") }) }) } } }