menu updates

This commit is contained in:
karl.hudgell 2020-06-21 13:10:29 +01:00
parent d16d10e311
commit cb6db28c66
2 changed files with 61 additions and 6 deletions

20
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\app.js",
"env": {
"BOTTOKEN": "1012409404:AAE-Vt0W_Cfp6ENnz1aZgPaBW_7_kBD7CJI"
}
}
]
}

47
app.js
View File

@ -1,6 +1,6 @@
const TelegramBot = require('node-telegram-bot-api');
const token = '1012409404:AAE-Vt0W_Cfp6ENnz1aZgPaBW_7_kBD7CJI';
const token = process.env.BOTTOKEN;
const bot = new TelegramBot(token, { polling: true });
@ -8,7 +8,7 @@ bot.on('message', (msg) => {
var hi = "hi";
if (msg.text.toString().toLowerCase().indexOf(hi) === 0) {
bot.sendMessage(msg.chat.id, "Hello dear user");
bot.sendMessage(msg.chat.id, "Hello " + msg.from.first_name + " Please type /start");
}
var bye = "bye";
@ -16,11 +16,46 @@ bot.on('message', (msg) => {
bot.sendMessage(msg.chat.id, "Hope to see you around again , Bye");
}
// const faq = "faq";
// if (msg.text.toString().toLocaleLowerCase().includes(faq)) {
// // bot.sendMessage(msg.chat.id, "Here are Frequently Asked Questions");
// // bot.sendMessage(msg.chat.id, "Please only ask an Admin, if you can't find the answer here..");
// }
}),
bot.onText(/\/start/, (msg) => {
bot.onText(/^(\/start|Home)$/, (msg) => {
bot.sendMessage(msg.chat.id, "Welcome to BigBoxLittleBox Bot");
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(/Subscriptions/, (msg) => {
bot.sendMessage(msg.chat.id, "Please only ask an Admin, if you can't find the answer here..", {
"reply_markup": {
"keyboard": [["Subscription Prices"],
["How to get a subscription?"],
["Subscriptions URLs", "Can I stream on multiple devices?"],
["Updates Group"],
["Install FileLinked on FireStick", "Install FileLinked on Android"],
["Home"]]
}
})
})