-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.js
More file actions
33 lines (28 loc) · 1.29 KB
/
bot.js
File metadata and controls
33 lines (28 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const TelegramBot = require('node-telegram-bot-api');
// API Token Telegram
const token = '635268753:AAEwe44Q6e0VYxlogS7W9VQZT5DG0PlbtE0';
// Creamos un bot que usa 'polling'para obtener actualizaciones
const bot = new TelegramBot(token, {polling: true});
const request = require('request');
// Mensaje de bienvenida "/start" reconoce el nombre del usuario que inicia el Bot
bot.on('message', (msg) => {
var start = "/start";
if (msg.text.toString().toLowerCase().indexOf(start) === 0) {
bot.sendMessage(msg.chat.id, "Hola " + msg.from.username + "\nSoy un bot creado en nodejs, ¿Que quieres hacer primero?\n\n /ListaApks\n/ListaDePeliculas");
}
});
bot.on('message', (msg) => {
var estado = "Me encuentro bien";
if (msg.text.toString().toLowerCase().indexOf(estado) === 0) {
bot.sendMessage(msg.chat.id, "Me alegro! \nes bueno saber eso :)");
}
});
bot.onText(/picsart/, (msg) => {
bot.sendDocument(msg.chat.id,"https://t.me/PiracyPoNy/101",{caption : "Mod: Caracteristicas premium desbloqueadas\n@PiracyPoNy"} );
});
bot.on('message', (msg) => {
var list = "/listaapks";
if (msg.text.toString().toLowerCase().indexOf(list) === 0) {
bot.sendMessage(msg.chat.id, "Esta es nuestra lista más actual de Apks " + msg.from.username + "\n\n/picsart");
}
});