This commit is contained in:
Karl 2025-04-21 07:46:35 +00:00
parent 44bbf97c11
commit 1f5fccf6a2
8 changed files with 37 additions and 220 deletions

6
.vscode/launch.json vendored
View File

@ -4,6 +4,8 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"type": "node", "type": "node",
"request": "launch", "request": "launch",
@ -11,7 +13,7 @@
"skipFiles": [ "skipFiles": [
"<node_internals>/**" "<node_internals>/**"
], ],
"program": "${workspaceFolder}\\app.js", "program": "${workspaceFolder}/app.js",
}, },
{ {
"type": "node", "type": "node",
@ -20,7 +22,7 @@
"skipFiles": [ "skipFiles": [
"<node_internals>/**" "<node_internals>/**"
], ],
"program": "${workspaceFolder}\\test.js", "program": "${workspaceFolder}/test.js",
} }
] ]
} }

View File

@ -1,6 +1,10 @@
const fs = require('fs') const fs = require('fs')
let ad = JSON.parse(fs.readFileSync('./data/group/admins.json', 'utf8')) let ad = JSON.parse(fs.readFileSync('./data/group/admins.json', 'utf8'))
let adminArray= [] let adminArray = []
// const questions = require('./data/bot/lib/questions')
const questions = require('../../lib/questions')
for (const x of ad) { for (const x of ad) {
adminArray.push(x.ADMIN) adminArray.push(x.ADMIN)
@ -26,6 +30,8 @@ module.exports = {
// console.log(subs); // console.log(subs);
fs.writeFileSync('./data/group/subs.json', JSON.stringify(subs)) fs.writeFileSync('./data/group/subs.json', JSON.stringify(subs))
bot.sendMessage(msg.chat.id, sub + " sub updated") bot.sendMessage(msg.chat.id, sub + " sub updated")
msg.chat.id = process.env.CHANNEL_ID
questions.subStatus(bot, msg, logger, true)
} }
} }

View File

@ -14,7 +14,7 @@ module.exports = {
bot.sendMessage(msg.chat.id, randomSub.SUB + "!"); bot.sendMessage(msg.chat.id, randomSub.SUB + "!");
} }
}, },
subStatus: (bot, msg, logger, name) => { subStatus: async (bot, msg, logger, notify = false) => {
let subs = JSON.parse(fs.readFileSync('./data/group/subs.json', 'utf8')) let subs = JSON.parse(fs.readFileSync('./data/group/subs.json', 'utf8'))
let string = "" let string = ""
@ -33,7 +33,10 @@ module.exports = {
} }
}); });
// console.log(string) // console.log(string)
bot.sendMessage(msg.chat.id, string, { parse_mode: "HTML" }) data = await bot.sendMessage(msg.chat.id, string, { parse_mode: "HTML", disable_notification: notify })
if (notify == true) {
bot.pinChatMessage(process.env.CHANNEL_ID, data.message_id)
}
}, },
adminStatus: (bot, msg, logger, name) => { adminStatus: (bot, msg, logger, name) => {
let admins = JSON.parse(fs.readFileSync('./data/group/admins.json', 'utf8')) let admins = JSON.parse(fs.readFileSync('./data/group/admins.json', 'utf8'))
@ -59,12 +62,12 @@ module.exports = {
password: (bot, msg, match, logger) => { password: (bot, msg, match, logger) => {
logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " Asked how to get a subscription"); logger.info("ID - " + msg.from.id + " First Name - " + msg.from.first_name + " Asked how to get a subscription");
// console.log(string) // console.log(string)
let sendString = new Nato(match) let sendString = new Nato(match)
bot.sendMessage(msg.chat.id, sendString.nato, { bot.sendMessage(msg.chat.id, sendString.nato, {
force_reply: true, force_reply: true,
parse_mode: "HTML" parse_mode: "HTML"
}) })
} }
} }

View File

@ -12,7 +12,8 @@ module.exports = {
var options = { var options = {
method: 'GET', method: 'GET',
url: 'https://football-pro.p.rapidapi.com/api/v2.0/livescores', url: 'https://football-pro.p.rapidapi.com/api/v2.0/livescores',
qs: { tz: 'Europe/London', leagues: '8,2,5,23,24', include: 'localTeam,visitorTeam' }, // qs: { tz: 'Europe/London', leagues: '2,5,8', include: 'localTeam,visitorTeam' },
// qs: { tz: 'Europe/London', leagues: '2,5,8,23,24,27,45,81', include: 'localTeam,visitorTeam' },
headers: { headers: {
'x-rapidapi-host': 'football-pro.p.rapidapi.com', 'x-rapidapi-host': 'football-pro.p.rapidapi.com',
'x-rapidapi-key': process.env.RAPIDAPI_API_KEY, 'x-rapidapi-key': process.env.RAPIDAPI_API_KEY,

View File

@ -167,7 +167,7 @@ const chat = [
{ {
"NAME": "- How to get a subscription?", "NAME": "- How to get a subscription?",
"TEXT": [ "TEXT": [
"To purchase a subscription you need to send a DM to any of the Admins in the group @Scotslad, @manclad72 or @bob_15.", "To purchase a subscription you need to send a DM to any of the Admins in the group @Scotslad, @manclad72 or @Sarbob15.",
"PLEASE ONLY DM ONE ADMIN AND WAIT FOR THEM TO GET BACK TO YOU.", "PLEASE ONLY DM ONE ADMIN AND WAIT FOR THEM TO GET BACK TO YOU.",
"When you DM to purchase the subscription please let the Admin know:\n\n1. what device the sub is going onto\n2. If there's a specific username you would like and\n3. If you don't want adult channels included. If you don't want adult channels and don't mention it when purchasing Your sub WILL be issued WITH adult channels. These can't be removed" "When you DM to purchase the subscription please let the Admin know:\n\n1. what device the sub is going onto\n2. If there's a specific username you would like and\n3. If you don't want adult channels included. If you don't want adult channels and don't mention it when purchasing Your sub WILL be issued WITH adult channels. These can't be removed"
], ],

View File

@ -1,7 +1,7 @@
[ [
{ {
"ADMIN": 868225940, "ADMIN": 868225940,
"NAME": "@bob_15", "NAME": "@Sarbob15",
"REALNAME": "Sarah", "REALNAME": "Sarah",
"STATUS": 1 "STATUS": 1
}, },

View File

@ -1,196 +1 @@
[ [{"SUB":"Premium Plus","COST":"X","STATUS":1,"APPS":["Orange Player (TiviMate)","SMARTERS Green"]},{"SUB":"VIP","COST":25,"STATUS":0,"APPS":["Orange Player (TiviMate)","SMARTERS Green"]},{"SUB":"Python","COST":"X","STATUS":1,"APPS":["Orange Player (TiviMate)","SMARTERS Green"]},{"SUB":"Sunbed","COST":"X","STATUS":1,"APPS":["SMARTERS Green"]},{"SUB":"Old Premium","COST":"X","STATUS":1,"APPS":["Orange Player (TiviMate)","SMARTERS Green"]},{"SUB":"Bluemoon","COST":"X","STATUS":"X","APPS":["SMARTERS Green"]},{"SUB":"KDB","COST":20,"STATUS":1,"APPS":["Orange Player (TiviMate)","SMARTERS Green"]},{"SUB":"Shark","COST":"X","STATUS":1,"APPS":["Orange Player (TiviMate)","SMARTERS Green"]},{"SUB":"Mr Whippy","COST":18,"STATUS":1,"APPS":["Orange Player (TiviMate)","SMARTERS Green"]},{"SUB":"Foden","COST":"X","STATUS":1,"APPS":["Orange Player (TiviMate)","SMARTERS Green"]},{"SUB":"New Premium (tvob)","COST":"X","STATUS":1,"APPS":["SMARTERS Green"]},{"SUB":"DIAZ","COST":17,"STATUS":1,"APPS":["SMARTERS Green"]},{"SUB":"Titan","COST":16,"STATUS":1,"APPS":["SMARTERS Green"]},{"SUB":"Bonsai","COST":15,"STATUS":1,"APPS":["SMARTERS Green"]},{"SUB":"Simple","COST":"X","STATUS":1,"APPS":["SMARTERS Green"]},{"SUB":"Knight Rider","COST":"X","STATUS":1,"APPS":["SMARTERS Green"]},{"SUB":"Gold","COST":"X","STATUS":1,"APPS":["Orange Player (TiviMate)","SMARTERS Green"]},{"SUB":"Jizer","COST":14,"STATUS":1,"APPS":["Orange Player (TiviMate)","SMARTERS Green"]},{"SUB":"Keano","COST":"X","STATUS":1,"APPS":["Orange Player (TiviMate)","SMARTERS Green"]},{"SUB":"Technoid","COST":"X","STATUS":1,"APPS":["Orange Player (TiviMate)","SMARTERS Green"]},{"SUB":"Bronze","COST":"X","STATUS":"X","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":"X","APPS":["SMARTERS Green"]},{"SUB":"Gunslinger","COST":7,"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"
}
]

26
package-lock.json generated
View File

@ -61,9 +61,9 @@
} }
}, },
"bl": { "bl": {
"version": "1.2.2", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz",
"integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==",
"requires": { "requires": {
"readable-stream": "^2.3.5", "readable-stream": "^2.3.5",
"safe-buffer": "^5.1.1" "safe-buffer": "^5.1.1"
@ -383,9 +383,9 @@
} }
}, },
"lodash": { "lodash": {
"version": "4.17.15", "version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
}, },
"mime": { "mime": {
"version": "1.6.0", "version": "1.6.0",
@ -406,16 +406,16 @@
} }
}, },
"minimist": { "minimist": {
"version": "0.0.8", "version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
}, },
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.5",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "^1.2.5"
} }
}, },
"ms": { "ms": {