Keith/app.js
karl.hudgell 0ad80be2bc updates
2020-06-21 14:28:52 +01:00

224 lines
14 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const TelegramBot = require('node-telegram-bot-api');
const token = process.env.BOTTOKEN;
const bot = new TelegramBot(token, {
polling: true
});
bot.on('message', (msg) => {
const hi = "hi";
if (msg.text.toString().toLowerCase().indexOf(hi) === 0) {
bot.sendMessage(msg.chat.id, "Hello " + msg.from.first_name + " Please press /start");
}
const bye = "bye";
if (msg.text.toString().toLowerCase().includes(bye)) {
bot.sendMessage(msg.chat.id, "Hope to see you around again , Bye");
}
const subPrice = "subscription prices";
if (msg.text.toString().toLowerCase().includes(subPrice)) {
bot.sendMessage(msg.chat.id, "PREMIUM PLUS ----£30\nVIP-----------------------£25\nOLD PREMIUM -----£17\nBLUEMOON ---------£15\nKDB --------------------£14\nGOLD ------------------£13\nTECHNOID -----------£13\nBRONZE --------------£10\nSOL ---------------------£10")
.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.")
})
})
}
const howToSignUp = "how to get a subscription?";
if (msg.text.toString().toLowerCase().includes(howToSignUp)) {
bot.sendMessage(msg.chat.id, "To purchase a subscription you need to send a DM to any of the Admins in the group @Scotslad, @manclad72 or @bob_15.")
.then(() => {
return bot.sendMessage(msg.chat.id, "PLEASE ONLY DM ONE ADMIN AND WAIT FOR THEM TO GET BACK TO YOU.").then(() => {
return bot.sendMessage(msg.chat.id, "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")
})
})
}
const suburls = "subscription urls";
if (msg.text.toString().toLowerCase().includes(suburls)) {
bot.sendMessage(msg.chat.id, "In this IPTV room we don't give out sub URLs or m3us. We have dedicated apps to play all subs on your Android box or IPTV player in our FileLinked.");
}
const multipleDevices = "can i stream on multiple devices?";
if (msg.text.toString().toLowerCase().includes(multipleDevices)) {
bot.sendMessage(msg.chat.id, "No. All subs sold is this room are one connection subs unless otherwise stated.\n\nThis means that you can have your sub loaded onto as many devices as you want (eg Android phone, tablet, Firestick, Android TV box) BUT you can only play the sub from one device at a time.")
.then(() => {
return bot.sendMessage(msg.chat.id, "Otherwise you may lose your sub altogether!")
})
}
const updatesGroup = "updates group";
if (msg.text.toString().toLowerCase().includes(updatesGroup)) {
bot.sendMessage(msg.chat.id, "The updates groups can be found here")
.then(() => {
return bot.sendMessage(msg.chat.id, "https://t.me/joinchat/AAAAAFDxZ2rzgAW5acahxA").then(() => {
return bot.sendMessage(msg.chat.id, "Please join for BBLBTV updates")
})
})
}
const installOnFire = "install filelinked on firestick";
if (msg.text.toString().toLowerCase().includes(installOnFire)) {
bot.sendMessage(msg.chat.id, "Step 1:\n\nGo to Settings > device/my fire tv > developer options > apps from unknown sources on")
.then(() => {
return bot.sendMessage(msg.chat.id, "Step 2: download an app called downloader. (Orange icon)").then(() => {
return bot.sendMessage(msg.chat.id, "Step 3:\nOpen downloader and type in this address\nhttp://get.filelinked.com\nThen when it asks, install that app.").then(() => {
return bot.sendMessage(msg.chat.id, "Step 4:\nPress and hold home and then click on “Apps” and scroll to the bottom and click on the very last app and open it (filelinked).").then(() => {
return bot.sendMessage(msg.chat.id, "Step 5: Enter the filelinked code from the Updates page to get the list of apps for your sub")
})
})
})
})
}
const installoOnAndroid = "install filelinked on android";
if (msg.text.toString().toLowerCase().includes(installoOnAndroid)) {
bot.sendMessage(msg.chat.id, "First thing you need to do is go to browser on your Android TV box and enter www.filelinked.com")
.then(() => {
return bot.sendMessage(msg.chat.id, "From this browser page, download FileLinked.").then(() => {
return bot.sendMessage(msg.chat.id, "Once you have pressed download then you can close the browser and go to your apps.").then(() => {
return bot.sendMessage(msg.chat.id, "Then open file manager or file browser. In here go to downloads, filemanager, press install.").then(() => {
return bot.sendMessage(msg.chat.id, "Then go back to your apps section on the box and find filelinked app.").then(() => {
return bot.sendMessage(msg.chat.id, "Open the app and enter the code.")
})
})
})
})
})
}
const SurfShark = "vpn (surfshark)";
if (msg.text.toString().toLowerCase().includes(SurfShark)) {
bot.sendMessage(msg.chat.id, "SurfShark is the VPN that we advise you use on your device to bypass the blocks,\n\nYou can install this on your device from our FileLinked\n\nWe provide a username and password for you to use in the updates groups. DO NOT SHARE THE DETAILS");
}
const iptvGuidance = "iptv guidance";
if (msg.text.toString().toLowerCase().includes(iptvGuidance)) {
bot.sendMessage(msg.chat.id, "🚨Basic IPTV Guidance🚨\n\nPlease see below some very basic IPTV guidance for those who are new to IPTV")
.then(() => {
return bot.sendMessage(msg.chat.id, "1. What is a sub? A sub is what provides you with your live tv and movies/VOD... They are called different names e.g. GOLD, PREMIUM, ETC... All offer very similar channels with the difference of VOD, Series and time and money spent on servers.").then(() => {
return bot.sendMessage(msg.chat.id, "2. What is an APP? An app is something that you load your sub onto, and enables you to view the channels your sub provides.").then(() => {
return bot.sendMessage(msg.chat.id, "3. What is the difference m3u and Stbemu? you simply add a username...password and url (M3U) to apps such as SMARTERS,XCIPTV that you get when you purchase your sub (the username and password is in effect your sub) These subs can normally be used on multiple devices but only one at a time. Stbemu is a (mac) based app, you give the admin your mac address and they give you a portal (URL) to add to the stbemu app. The latest version on Stbemu is available in my filelinked. Stbemu subs are generally MAC, Serial and Device locked, and are not advised to anyone new to IPTV!!!!").then(() => {
return bot.sendMessage(msg.chat.id, "4. For flexibility and ease of use username and password subs are far better for anyone new to IPTV certain subs have their own dedicated apps and are available to download from my filelinked. I have at least one app available for every sub I sell in this room.").then(() => {
return bot.sendMessage(msg.chat.id, "5. Things you must know when using IPTV How to refresh DNS How to change your app player settings How to change your app player to an external player How to carry out basic but essential IPTV Maintenance.")
})
})
})
})
})
}
const iptvMaintenance = "basic iptv maintenance";
if (msg.text.toString().toLowerCase().includes(iptvMaintenance)) {
bot.sendMessage(msg.chat.id, "🚨Basic IPTV Maintenance🚨\n\nReboot Router, Reboot Device.\nClear all app caches - Go to settings - Applications - Manage installed applications - click on app and select clear cache. Do this for all installed applications.")
.then(() => {
return bot.sendMessage(msg.chat.id, "To refresh DNS\nClick on add user\nRefresh DNS\nList users\nLog back in").then(() => {
return bot.sendMessage(msg.chat.id, "Adding external players and changing player settings (decoder)\n\nClick the three dots in top corner and select settings.\nClick external players, and add VLC and MX Players.\nGo back one screen and click player selection.\nAt the side of live tv click whichever player you prefer, for live tv and catch up, the built in player generally works best, and choose an external player for VOD and series.\nYou may also find that changing your player setting to HW or Native can help with freezing/stuttering stream issues.").then(() => {
return bot.sendMessage(msg.chat.id, "To get the most from your IPTV you have to take a little time to learn how IPTV works How you do this is by investing a little of your time and reading through previous group messages, you do not have to read through 1000s of messages, simply use the group search function. Also do the same with the updates group, this way your IPTV experience will be a very positive, downtime and buffer free one.").then(() => {
return bot.sendMessage(msg.chat.id, "Using search function\n\nTo save time having to scroll through 1000s of messages utilise the telegram search function, this can be used to search for specific key words.\n\nSimply click on the group name (3dots at the top right of screen)\n\nThis will bring a sub menu select the word search and then type the word you are searching for e.g. your sub name, it will then bring up all messages featuring the word you have searched for.")
})
})
})
})
}
const doIneedVPN = "do i need a vpn?";
if (msg.text.toString().toLowerCase().includes(doIneedVPN)) {
bot.sendMessage(msg.chat.id, "You only need a VPN if your subscription isn't working at the time of use, normally only when the Football is on do the subs get blocked, if they do, connect using SurfShark using the details provided in the updates channel, DO NOT SHARE THESE DETAILS!");
}
}),
bot.onText(/^(\/start|Home)$/, (msg) => {
bot.sendMessage(msg.chat.id, "Please use the buttons below to navigate", {
"reply_markup": {
"keyboard": [
["FAQ", "Applications"]
]
}
})
})
bot.onText(/^FAQ$/, (msg) => {
bot.sendMessage(msg.chat.id, "Frequently Asked Questions")
.then(() => {
return bot.sendMessage(msg.chat.id, "Please only ask an Admin, if you can't find the answer here..", {
"reply_markup": {
"keyboard": [
["Subscriptions", "IPTV"],
["Home"]
]
}
})
})
})
bot.onText(/Applications/, (msg) => {
bot.sendMessage(msg.chat.id, "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").then(() => {
return bot.sendMessage(msg.chat.id, "There are 2 new XCIPTV apps, Blue and Red.\nEach have 3 different sub DNS (URLs) already embedded in the players.").then(() => {
return bot.sendMessage(msg.chat.id, "Sky Q app (yellow player) this holds 4 of the room subs.").then(() => {
return bot.sendMessage(msg.chat.id, "All of the room subs play on the green smarters player", {
"reply_markup": {
"keyboard": [
["What app should I use?"],
["VPN (SurfShark)"],
["FileLinked"],
["Home"]
]
}
})
})
})
})
})
bot.onText(/^Subscriptions$/, (msg) => {
bot.sendMessage(msg.chat.id, "Subscription FAQ", {
"reply_markup": {
"keyboard": [
["Subscription Prices"],
["How to get a subscription?"],
["Subscription URLs", "Can I stream on multiple devices?"],
["Updates Group"],
["Install FileLinked on FireStick", "Install FileLinked on Android"],
["Home"]
]
}
})
})
bot.onText(/^IPTV$/, (msg) => {
bot.sendMessage(msg.chat.id, "IPTV FAQ", {
"reply_markup": {
"keyboard": [
["IPTV Guidance"],
["Basic IPTV Maintenance"],
["Do I need a VPN?"],
["IPTV Bible"],
["Home"]
]
}
})
})
bot.onText(/^FileLinked$/, (msg) => {
bot.sendMessage(msg.chat.id, "The current FileLinked code is - 47054161\n\nYou can download all our players from there", {
"reply_markup": {
"keyboard": [
["Install FileLinked on FireStick", "Install FileLinked on Android"],
["Home"]
]
}
})
})