node-telegram-api/README.md

62 lines
1.7 KiB
Markdown
Raw Normal View History

2015-07-04 04:05:25 +04:30
Telegram Bots
=============
Create and control [Telegram bots](https://core.telegram.org/bots) easily
using the new [Telegram API](https://core.telegram.org/bots/api).
2015-06-26 21:50:54 +04:30
```
npm install telegram-api
2015-06-26 21:50:54 +04:30
```
2015-07-04 04:08:30 +04:30
telegram-api is in beta, your feedback is appreciated, please [fill an issue](https://github.com/mdibaiee/node-telegram-api/issues)
for any bugs you find or any suggestions you have.
2015-06-30 12:17:14 +04:30
If you are cloning this repository, remember to run `npm install` to install dependencies.
2015-07-04 04:08:30 +04:30
If you are looking for a real-life example of a bot written using this module, see [mdibaiee/javascriptbot](https://github.com/mdibaiee/javascriptbot).
2015-07-04 04:05:25 +04:30
[Documentation](https://github.com/mdibaiee/node-telegram-api/wiki)
==============
2015-07-04 04:03:35 +04:30
2015-07-04 04:05:25 +04:30
Example
=======
2015-07-04 04:03:35 +04:30
```javascript
var Bot = require('telegram-api');
var Message = require('telegram-api/types/Message');
var File = require('telegram-api/types/File');
var bot = new Bot({
token: 'YOUR_TOKEN'
});
bot.start();
bot.get(/Hi|Hey|Hello|Yo/, function(message) {
var answer = new Message().text('Hello, Sir').to(message.chat.id);
bot.send(answer);
});
bot.command('start', function(message) {
var welcome = new File().file('./some_photo.png').caption('Welcome');
bot.send(welcome);
});
```
2015-07-04 04:05:25 +04:30
Bots using this module
======================
2015-06-29 03:12:48 +04:30
2015-07-04 03:56:15 +04:30
[@JavaScriptBot](https://telegram.me/JavaScriptBot) => [mdibaiee/javascriptbot](https://github.com/mdibaiee/javascriptbot)
2015-06-29 03:12:48 +04:30
2015-07-04 04:05:25 +04:30
Todo
====
- [x] Webhook support (not tested, see [#4](https://github.com/mdibaiee/node-telegram-api/issues/4))
2015-07-01 02:34:44 +04:30
- [x] Forward Type
2015-07-03 17:36:07 +04:30
- [x] BulkMessage Type
2015-07-03 03:03:22 +04:30
- [x] File Type
2015-06-29 03:18:44 +04:30
- [ ] Sticker Type
- [ ] Location Type
- [ ] Contact Type
- [ ] Allow remote control of bots (TCP maybe)
2015-06-29 03:24:41 +04:30
- [ ] YOUR IDEAS! [Fill an issue](https://github.com/mdibaiee/node-telegram-api/issues)