Update README

This commit is contained in:
Mahdi Dibaiee 2015-06-27 03:06:59 +04:30
parent 9440d8be48
commit 38790c5ce2

View File

@ -8,7 +8,7 @@ npm install telegram-api
# Example # Example
```javascript ```javascript
var Bot = require('./index'); var Bot = require('telegram-api');
var smartBot = new Bot({ var smartBot = new Bot({
token: 'YOUR_KEY' token: 'YOUR_KEY'
@ -24,7 +24,7 @@ smartBot.get('Hi', function(update) {
const question = 'How should I greet you?', const question = 'How should I greet you?',
answers = ['Hi', 'Hello, Sir', 'Yo bro']; answers = ['Hi', 'Hello, Sir', 'Yo bro'];
smartBot.askQuestion(id, question, answers) smartBot.replyTo(message.message_id).askQuestion(id, question, answers)
.then(answer => { .then(answer => {
smartBot.message(id, 'Your answer: ' + answer); smartBot.message(id, 'Your answer: ' + answer);
}, () => { }, () => {