working app switch

This commit is contained in:
karl.hudgell 2020-06-28 21:43:40 +01:00
parent 23eb991913
commit 900c598c15
3 changed files with 50 additions and 44 deletions

30
app.js
View File

@ -70,9 +70,9 @@ bot.on('message', (msg) => {
bot_questions.subStatus(bot, msg, logger)
// listen for "set sub X to X"
bot_subStatus.setSubStatus(bot, msg, logger)
bot_faq_whatAppToUse.main(bot, msg, logger)
bot_faq_whatAppToUse.gold(bot, msg, logger)
bot_faq_whatAppToUse.appSwitch(bot, msg, logger)
// FAQ susbcription prices
bot_faq_subscription.prices(bot, msg, logger)
@ -287,32 +287,6 @@ Do not clear data, otherwise you will have to enter your sub details into the ap
}
}
const vip = "- vip"
const premiumPlus = "- premium plus"
const oldPremium = "- old premium"
if (msg.text && msg.text.toString().toLowerCase() === vip || msg.text && msg.text.toString().toLowerCase() === premiumPlus || msg.text && msg.text.toString().toLowerCase() === oldPremium) {
bot.sendMessage(msg.chat.id, "You can use -\nXCIPTV Blue\nSky Q Yellow\nSMARTERS Green\n\nAll can be downloaded from our FileLinked")
}
const bronze = "- bronze"
if (msg.text && msg.text.toString().toLowerCase() === bronze) {
bot.sendMessage(msg.chat.id, "You can use -\nXCIPTV Red\nSMARTERS Green\n\nAll can be downloaded from our FileLinked")
}
const newPremium = "- new premium"
const kdb = "- kdb"
const technoid = "- technoid"
const bluemoon = "- bluemoon"
const sol = "- sol"
const gambler = "- gambler"
if ((msg.text && msg.text.toString().toLowerCase() === newPremium) || (msg.text && msg.text.toString().toLowerCase() === kdb) || (msg.text && msg.text.toString().toLowerCase() === gambler) || (msg.text && msg.text.toString().toLowerCase() === technoid) || (msg.text && msg.text.toString().toLowerCase() === bluemoon) || (msg.text && msg.text.toString().toLowerCase() === sol)) {
bot.sendMessage(msg.chat.id, "You can use -\nSMARTERS Green\n\nAll can be downloaded from our FileLinked")
}
}),
bot.onText(/^(\/start|\/help|- Home)$/, (msg) => {
logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " Started a Chat with me");

View File

@ -22,12 +22,8 @@ module.exports = {
})
}
},
gold: (bot, msg, logger) => {
//if (msg.text && msg.text.toString().toLowerCase() === subArray.indexOf(msg.text && msg.text.toString().toLowerCase())) {
const gold = "- gold"
appSwitch: (bot, msg, logger) => {
let string = ""
// if (msg.text && msg.text.toString().toLowerCase() === gold) {
if (subArray.indexOf(msg.text && msg.text.toString().toLowerCase())) {
var checkSub = msg.text.substring(2)
subs.forEach(element => {
@ -36,7 +32,6 @@ module.exports = {
let catString = element
string += '\n' + catString;
})
console.log(string)
}
}
);

View File

@ -1,23 +1,44 @@
[{
"SUB": "Premium Plus",
"COST": 30,
"STATUS": 1
"STATUS": 1,
"APPS": [
"XCIPTV Blue",
"Sky Q Yellow",
"SMARTERS Green"
]
}, {
"SUB": "VIP",
"COST": 25,
"STATUS": 1
"STATUS": 1,
"APPS": [
"XCIPTV Blue",
"Sky Q Yellow",
"SMARTERS Green"
]
}, {
"SUB": "Old Premium",
"COST": 17,
"STATUS": 1
"STATUS": 1,
"APPS": [
"XCIPTV Blue",
"Sky Q Yellow",
"SMARTERS Green"
]
}, {
"SUB": "Bluemoon",
"COST": 15,
"STATUS": 1
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
}, {
"SUB": "KDB",
"COST": 14,
"STATUS": 1
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
}, {
"SUB": "Gold",
"COST": 13,
@ -30,23 +51,39 @@
}, {
"SUB": "Technoid",
"COST": 13,
"STATUS": 1
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
}, {
"SUB": "Bronze",
"COST": 10,
"STATUS": 1
"STATUS": 1,
"APPS": [
"XCIPTV Red",
"SMARTERS Green"
]
}, {
"SUB": "SOL",
"COST": 10,
"STATUS": 1
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
}, {
"SUB": "New Premium (tvob)",
"COST": "X",
"STATUS": 1
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
}, {
"SUB": "Gambler",
"COST": "X",
"STATUS": 1
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
}, {
"SUB": "All of em",
"COST": "X",