2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-30 13:58:27 +00:00

Update polling.js

This commit is contained in:
Yago
2015-10-20 09:47:58 +02:00
parent 9654b336e2
commit 723dbae5a8

View File

@@ -12,6 +12,7 @@ bot.getMe().then(function (me) {
console.log('Hi my name is %s!', me.username);
});
// Matches /photo
bot.onText(/\/photo/, function (msg) {
var chatId = msg.chat.id;
// From file
@@ -19,6 +20,7 @@ bot.onText(/\/photo/, function (msg) {
bot.sendPhoto(chatId, photo, {caption: "I'm a bot!"});
});
// Matches /audio
bot.onText(/\/audio/, function (msg) {
var chatId = msg.chat.id;
var url = 'https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg';
@@ -32,6 +34,7 @@ bot.onText(/\/audio/, function (msg) {
});
});
// Matches /love
bot.onText(/\/love/, function (msg) {
var chatId = msg.chat.id;
var opts = {