Update polling.js

experimental
Yago 10 years ago
parent 9654b336e2
commit 723dbae5a8
  1. 3
      examples/polling.js

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

Loading…
Cancel
Save