Compare commits

...

11 Commits

Author SHA1 Message Date
44bbf97c11 sub updates 2021-03-08 15:11:00 +00:00
fefc83f765 updates 2021-01-30 15:03:12 +00:00
b7cc345465 update football text 2021-01-20 13:43:24 +00:00
a70c6d6e0e update subs 2020-11-24 15:34:07 +00:00
d162eec85e latest cut 2020-11-07 12:47:46 +00:00
ddb57fc761 string fix 2020-09-06 17:57:23 +00:00
karl.hudgell
a3bde039e3 Merge branch 'master' of http://kithub.cf/TelegramBots/BBLBTV_Suzie 2020-08-03 20:08:09 +01:00
karl.hudgell
ebf7266d4a admins fix 2020-08-03 20:04:50 +01:00
karl.hudgell
98e24efdd6 updats 2020-08-03 20:01:19 +01:00
karl.hudgell
0aacec6fa6 tell me my password and admins 2020-08-03 20:00:59 +01:00
421d916ed7 updates 2020-08-03 11:45:46 +00:00
13 changed files with 343 additions and 27 deletions

0
UpdateBot.sh Normal file → Executable file
View File

10
app.js
View File

@ -42,6 +42,10 @@ bot.on('message', (msg) => {
questions.subStatus(bot, msg, logger)
}
if (msg.text && msg.text.toString().includes("/admins")) {
questions.adminStatus(bot, msg, logger)
}
if (msg.text && msg.text.toString().includes("/football_today")) {
requests.football_today(bot, msg, logger)
}
@ -76,9 +80,13 @@ bot.on('message', (msg) => {
common.chat(bot, msg, match, logger)
}
if (msg.text && msg.text.toString().includes("/password")) {
match = msg.text.substring(10);
questions.password(bot, msg, match, logger)
}
if (msg.text && msg.text.toString().toLowerCase().includes("set sub")) {
bot_subStatus.setSubStatus(bot, msg, logger)
}
});

View File

@ -13,7 +13,9 @@ module.exports = {
});
bot.sendMessage(msg.chat.id, string, { parse_mode: "HTML" }).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.")
return bot.sendMessage(msg.chat.id, "Apart from Gunslinger, its LIFETIME.").then(() => {
return bot.sendMessage(msg.chat.id, "Keep an eye out though because we offer special deals on different subs from time to time.")
})
})
})
}

View File

@ -0,0 +1,32 @@
const fs = require('fs')
let ad = JSON.parse(fs.readFileSync('./data/group/admins.json', 'utf8'))
let adminArray= []
for (const x of ad) {
adminArray.push(x.ADMIN)
}
module.exports = {
setSubStatus: (bot, msg, logger, name) => {
let subs = JSON.parse(fs.readFileSync('./data/group/subs.json', 'utf8'))
if (adminArray.indexOf(msg.from.id) > -1) {
sub = msg.text.match(/(?<=set sub )(.*)(?= to (up|down))/g)[0]
status = msg.text.match(/\w+(?=( \w+){0}$)/g)[0]
logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " updated " + sub + " to " + status);
if (status === "up") {
status = 1
} else {
status = 0
}
subs.forEach(function (element, index) {
if (element.SUB.toLowerCase() === sub.toLowerCase()) {
subs[index].STATUS = status; //set the value
}
})
// console.log(subs);
fs.writeFileSync('./data/group/subs.json', JSON.stringify(subs))
bot.sendMessage(msg.chat.id, sub + " sub updated")
}
}
}

View File

@ -1,10 +1,15 @@
const fs = require('fs')
const admins = JSON.parse(process.env.ADMIN_ID)
let ad = JSON.parse(fs.readFileSync('./data/group/admins.json', 'utf8'))
let adminArray= []
for (const x of ad) {
adminArray.push(x.ADMIN)
}
module.exports = {
setSubStatus: (bot, msg, logger, name) => {
let subs = JSON.parse(fs.readFileSync('./data/group/subs.json', 'utf8'))
if (admins.indexOf(msg.from.id) > -1) {
if (adminArray.indexOf(msg.from.id) > -1) {
sub = msg.text.match(/(?<=set sub )(.*)(?= to (up|down))/g)[0]
status = msg.text.match(/\w+(?=( \w+){0}$)/g)[0]
logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " updated " + sub + " to " + status);

View File

@ -3,7 +3,7 @@ const channel = process.env.CHANNEL
module.exports = {
welcomeMessage: (bot, msg, logger) => {
const newUserMention = "<a href=\"tg:\/\/user?id=" + msg.new_chat_member.id + "\">@" + msg.new_chat_member.first_name + "<\/a>"
bot.sendMessage(msg.chat.id, "Hello " + newUserMention + ", Welcome to " + channel + ". \n\nPlease PM me @" + process.env.BOT_USERNAME + " to find out all needed information about our service before asking an admin or posting in here.\n\nIf you do ask questions, and its obvious you have not spoken to me, you will be booted from the room. This is IPTV, admins don't have time for hand holding.!!!\n\nPlease know that this is a Private IPTV group and you have 24 hours to purchase a sub with us. If you don't make a purchase by then please leave the room or you will be booted. Thanks", { parse_mode: "HTML" });
bot.sendMessage(msg.chat.id, "Hello " + newUserMention + ", Welcome to " + channel + ". \n\nPlease PM me @" + process.env.BOT_USERNAME + " to find out all needed information about our service before asking an admin or posting in here.\n\nIf you do ask questions, and its obvious you have not spoken to me, you will make the admins very unhappy. This is IPTV, admins don't have time for hand holding.!!!\n\nPlease know that this is a Private IPTV group and you have 24 hours to purchase a sub with us. If you don't make a purchase by then please leave the room or you will be removed. Thanks", { parse_mode: "HTML" });
logger.info("ID - " + msg.new_chat_member.id + " First Name - " + msg.new_chat_member.first_name + " joined the group");
}
};

View File

@ -1,4 +1,6 @@
const fs = require('fs')
const Nato = require('nato');
module.exports = {
whatSubShouldIBuy: (bot, msg, logger) => {
@ -17,20 +19,52 @@ module.exports = {
let string = ""
const subStatus = "sub status";
logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " Asked how to get a subscription");
subs.forEach(element => {
if (element.STATUS != "X") {
if (element.STATUS === 1) {
element.STATUS = "Up"
} else {
element.STATUS = "Down"
}
let catString = element.SUB + " Is " + element.STATUS
// console.log(catString)
string += '\n' + catString;
logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " Asked how to get a subscription");
subs.forEach(element => {
if (element.STATUS != "X") {
if (element.STATUS === 1) {
element.STATUS = "Up"
} else {
element.STATUS = "Down"
}
});
// console.log(string)
bot.sendMessage(msg.chat.id, string, { parse_mode: "HTML" })
}
}
let catString = element.SUB + " Is " + element.STATUS
// console.log(catString)
string += '\n' + catString;
}
});
// console.log(string)
bot.sendMessage(msg.chat.id, string, { parse_mode: "HTML" })
},
adminStatus: (bot, msg, logger, name) => {
let admins = JSON.parse(fs.readFileSync('./data/group/admins.json', 'utf8'))
let string = ""
const subStatus = "sub status";
logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " Asked how to get a subscription");
admins.forEach(element => {
if (element.STATUS != "X") {
if (element.STATUS === 1) {
element.STATUS = "Here"
} else {
element.STATUS = "Away"
}
let catString = element.NAME + " Is " + element.STATUS
// console.log(catString)
string += '\n' + catString;
}
});
// console.log(string)
bot.sendMessage(msg.chat.id, string, { parse_mode: "HTML" })
},
password: (bot, msg, match, logger) => {
logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " Asked how to get a subscription");
// console.log(string)
let sendString = new Nato(match)
bot.sendMessage(msg.chat.id, sendString.nato, {
force_reply: true,
parse_mode: "HTML"
})
}
}

View File

@ -34,10 +34,14 @@ module.exports = {
}
}).then(() => {
return bot.sendMessage(msg.chat.id, 'To see what channels the football is streaming on please join @footballontv')
return bot.sendMessage(msg.chat.id, `To see what channels the football is streaming on please join @FootballListings for free.
Or join @footballontv for a yearly membership fee.
Or type https://m.liveonsat.com/ into your browser.`)
})
} else {
bot.sendMessage(msg.chat.id, 'Sadly there is no football today :(')
bot.sendMessage(msg.chat.id, 'Sadly, there is no football I care about on today :(')
}
})
},

View File

@ -38,9 +38,13 @@ const chat = [
"NAME": "- Applications",
"TEXT": [
"We have a number of different applications that work with our subs, here is an overview of subs/apps colour coded by the icon in our FileLinked",
"There are 2 new XCIPTV apps, Blue and Red.\nEach have 3 different sub DNS (URLs) already embedded in the players.",
"Sky Q app (yellow player) this holds 4 of the room subs.",
"All of the room subs play on the green smarters player"
"There are 3 Xciptv apps. Blue, Red and Orange. Each have 3 different sub DNS (URLs) already embedded in the players.",
"Sky Q app (yellow player) this holds 4 of the room subs",
"SmartSky and Green players play most of the room subs",
"We also have a Purple player and White&Black, these are the same player that hold 4 different room subs each.",
"We also have a room web player that you can watch your subs on http://webservgroup.xyz/playersmart/",
"When you are in the bob15tv In filelinked room please look under each player to know what subs can be played on that particular player. Players will be added and deleted from our room filelinked regularly so do check in on the players we have available for your subs in our room filelinked on a regular basis.",
"The current FileLinked code is - " + process.env.FILELINKED_PIN + "\n\nYou can download all our players from there"
],
"MENU": '[["- What app should I use?"],["- VPN (SurfShark)"],["- FileLinked"],["- Home"]]'
},

26
data/group/admins.json Normal file
View File

@ -0,0 +1,26 @@
[
{
"ADMIN": 868225940,
"NAME": "@bob_15",
"REALNAME": "Sarah",
"STATUS": 1
},
{
"ADMIN": 470861863,
"NAME": "@manclad72",
"REALNAME": "MANC LAD",
"STATUS": 1
},
{
"ADMIN": 5156156,
"NAME": "@Scotslad",
"REALNAME": "ScotLad",
"STATUS": 0
},
{
"ADMIN": 434187971,
"NAME": "Karl",
"REALNAME": "Karl",
"STATUS": "X"
}
]

View File

@ -1 +1,196 @@
[{"SUB":"Premium Plus","COST":30,"STATUS":1,"APPS":["XCIPTV Blue","Sky Q Yellow","SMARTERS Green"]},{"SUB":"VIP","COST":25,"STATUS":1,"APPS":["XCIPTV Blue","Sky Q Yellow","SMARTERS Green"]},{"SUB":"Old Premium","COST":17,"STATUS":1,"APPS":["XCIPTV Blue","Sky Q Yellow","SMARTERS Green"]},{"SUB":"Bluemoon","COST":15,"STATUS":1,"APPS":["SMARTERS Green"]},{"SUB":"KDB","COST":14,"STATUS":1,"APPS":["SMARTERS Green"]},{"SUB":"Gold","COST":13,"STATUS":1,"APPS":["XCIPTV Red","Sky Q Yellow","SMARTERS Green"]},{"SUB":"Technoid","COST":13,"STATUS":1,"APPS":["SMARTERS Green"]},{"SUB":"Bronze","COST":10,"STATUS":1,"APPS":["XCIPTV Red","SMARTERS Green"]},{"SUB":"SOL","COST":10,"STATUS":1,"APPS":["SMARTERS Green"]},{"SUB":"New Premium (tvob)","COST":"X","STATUS":0,"APPS":["SMARTERS Green"]},{"SUB":"Gambler","COST":"X","STATUS":1,"APPS":["SMARTERS Green"]},{"SUB":"All of em","COST":"X","STATUS":"X"}]
[
{
"SUB": "Premium Plus",
"COST": "X",
"STATUS": 1,
"APPS": [
"Orange Player (TiviMate)",
"SMARTERS Green"
]
},
{
"SUB": "VIP",
"COST": 25,
"STATUS": 1,
"APPS": [
"Orange Player (TiviMate)",
"SMARTERS Green"
]
},
{
"SUB": "Python",
"COST": 25,
"STATUS": 1,
"APPS": [
"Orange Player (TiviMate)",
"SMARTERS Green"
]
},
{
"SUB": "Sunbed",
"COST": 25,
"STATUS": 1,
"APPS": [
"Orange Player (TiviMate)",
"SMARTERS Green"
]
},
{
"SUB": "Sunbed",
"COST": 25,
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
},
{
"SUB": "Old Premium",
"COST": "X",
"STATUS": 1,
"APPS": [
"Orange Player (TiviMate)",
"SMARTERS Green"
]
},
{
"SUB": "Bluemoon",
"COST": "X",
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
},
{
"SUB": "KDB",
"COST": 20,
"STATUS": 1,
"APPS": [
"Orange Player (TiviMate)",
"SMARTERS Green"
]
},
{
"SUB": "Shark",
"COST": 20,
"STATUS": 1,
"APPS": [
"Orange Player (TiviMate)",
"SMARTERS Green"
]
},
{
"SUB": "Foden",
"COST": 18,
"STATUS": 1,
"APPS": [
"Orange Player (TiviMate)",
"SMARTERS Green"
]
},
{
"SUB": "New Premium (tvob)",
"COST": 18,
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
},
{
"SUB": "DIAZ",
"COST": 17,
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
},
{
"SUB": "Simple",
"COST": 15,
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
},
{
"SUB": "Knight Rider",
"COST": 15,
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
},
{
"SUB": "Gold",
"COST": 14,
"STATUS": 1,
"APPS": [
"Orange Player (TiviMate)",
"SMARTERS Green"
]
},
{
"SUB": "Keano",
"COST": 13,
"STATUS": 1,
"APPS": [
"Orange Player (TiviMate)",
"SMARTERS Green"
]
},
{
"SUB": "Technoid",
"COST": 11,
"STATUS": 1,
"APPS": [
"Orange Player (TiviMate)",
"SMARTERS Green"
]
},
{
"SUB": "Bronze",
"COST": 11,
"STATUS": 1,
"APPS": [
"Orange Player (TiviMate)",
"SMARTERS Green"
]
},
{
"SUB": "SOL",
"COST": "X",
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
},
{
"SUB": "Irishlass",
"COST": 9,
"STATUS": 1,
"APPS": [
"Orange Player (TiviMate)",
"SMARTERS Green"
]
},
{
"SUB": "Gambler",
"COST": "X",
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
},
{
"SUB": "Gunslinger",
"COST": 7,
"STATUS": 1,
"APPS": [
"SMARTERS Green"
]
},
{
"SUB": "All of em",
"COST": "X",
"STATUS": "X"
}
]

5
package-lock.json generated
View File

@ -423,6 +423,11 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"nato": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/nato/-/nato-0.1.1.tgz",
"integrity": "sha1-nl9ZDf5B3xqb2ghColylazga2rg="
},
"node-telegram-bot-api": {
"version": "0.50.0",
"resolved": "https://registry.npmjs.org/node-telegram-bot-api/-/node-telegram-bot-api-0.50.0.tgz",

View File

@ -17,6 +17,7 @@
"cached-request": "^2.0.1",
"dotenv": "^8.2.0",
"fs": "0.0.1-security",
"nato": "^0.1.1",
"node-telegram-bot-api": "^0.50.0",
"perfect-logger": "^2.0.1",
"request": "^2.88.2",