2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-30 22:05:28 +00:00

Update README.md

This commit is contained in:
Yago
2015-06-29 22:19:19 +02:00
parent 860dc0aa91
commit c504fb14f0

View File

@@ -1,5 +1,23 @@
[![Build Status](https://travis-ci.org/yagop/telegram-bot-api.svg?branch=master)](https://travis-ci.org/yagop/telegram-bot-api) [![Coverage Status](https://coveralls.io/repos/yagop/telegram-bot-api/badge.svg?branch=develop)](https://coveralls.io/r/yagop/telegram-bot-api?branch=develop)
```sh
npm install node-telegram-bot-api
```
```js
var TelegramBot = require('node-telegram-bot-api');
var token = 'YOUR_TELEGRAM_BOT_TOKEN';
// Setup polling way
var bot = new TelegramBot(token, {polling: true});
bot.on('message', function (msg) {
var chatId = msg.chat.id;
// photo can be: a file path, a stream or a Telegram file_id
var photo = 'bot.gif';
bot.sendPhoto(chatId, photo, {caption: "I'm a bot!"});
});
```
* * *
## Class: TelegramBot