This commit is contained in:
karl.hudgell 2020-06-21 17:10:37 +01:00
parent 9c30681821
commit 8620f34dc7
5 changed files with 11 additions and 8 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
node_modules/
.env

6
.vscode/launch.json vendored
View File

@ -12,12 +12,6 @@
"<node_internals>/**"
],
"program": "${workspaceFolder}\\app.js",
"env": {
"BOT_TOKEN": "1012409404:AAE-Vt0W_Cfp6ENnz1aZgPaBW_7_kBD7CJI",
"BOT_NAME": "Keith",
"CHANNEL": "BBLBTV",
"FILELINKED_PIN": "47054161"
}
}
]
}

4
app.js
View File

@ -1,3 +1,5 @@
require('dotenv').config();
const TelegramBot = require('node-telegram-bot-api');
const token = process.env.BOT_TOKEN;
@ -12,7 +14,7 @@ bot.on('message', (msg) => {
const hi = "help";
if (msg.text.toString().toLowerCase().includes(hi)) {
bot.sendMessage(msg.chat.id, "Hello " + msg.from.first_name + " Please PM me @BBLBTV2_bot and i'll help.");
bot.sendMessage(msg.chat.id, "Hello " + msg.from.first_name + " Please PM me @" + process.env.BOT_USERNAME + " and i'll help.");
}
const bye = "bye";

5
package-lock.json generated
View File

@ -126,6 +126,11 @@
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
},
"dotenv": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
"integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw=="
},
"ecc-jsbn": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",

View File

@ -13,6 +13,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"dotenv": "^8.2.0",
"node-telegram-bot-api": "^0.50.0"
}
}