BobbyIPTV_Suzie/data/bot/faq/subscriptions.js

19 lines
727 B
JavaScript
Raw Normal View History

2020-06-26 20:51:38 +01:00
const fs = require('fs')
const subs = JSON.parse(fs.readFileSync('./data/group/subs.json', 'utf8'))
module.exports = {
2020-06-26 22:25:18 +01:00
pricesImageList: (bot, msg, logger) => {
const subPrice = "- subscription options";
2020-06-26 20:51:38 +01:00
if (msg.text && msg.text.toString().toLowerCase() === subPrice) {
logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " Got subscription Prices");
2020-06-26 22:25:18 +01:00
for (var i = 0, len = subs.length; i < len; i++) {
if (subs[i].IMAGE != "X") {
bot.sendPhoto(msg.chat.id, subs[i].IMAGE)
}
}
bot.sendMessage(msg.chat.id, "All of these prices are for 12 Month subscription subs")
2020-06-26 20:51:38 +01:00
}
}
}