Deprecated: A simple API to create and control Telegram bots
Go to file
2015-07-09 16:00:01 +04:30
build Fix required arguments 2015-07-09 16:00:01 +04:30
lib Fix required arguments 2015-07-09 16:00:01 +04:30
types Switch from restler to unirest 2015-07-06 04:35:25 +04:30
.gitignore initial commit 2015-06-26 21:50:54 +04:30
demo.gif smaller GIF 2015-06-27 04:50:25 +04:30
demo.js Add Argument Parser 💪 2015-07-05 18:06:27 +04:30
esdoc.json V2 - Big update 2015-06-29 03:12:48 +04:30
Gruntfile.js Instead of symlinking types, copy them to be compatible with windows and npm 2015-07-03 21:38:24 +04:30
index.js V2 - Big update 2015-06-29 03:12:48 +04:30
LICENSE Initial commit 2015-06-26 03:04:01 +04:30
package.json Fix required arguments 2015-07-09 16:00:01 +04:30
README.md Why was it like that 2015-07-04 04:08:30 +04:30

Telegram Bots

Create and control Telegram bots easily using the new Telegram API.

npm install telegram-api

telegram-api is in beta, your feedback is appreciated, please fill an issue for any bugs you find or any suggestions you have.

If you are cloning this repository, remember to run npm install to install dependencies.

If you are looking for a real-life example of a bot written using this module, see mdibaiee/javascriptbot.

Documentation

Example

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);
});

Bots using this module

@JavaScriptBot => mdibaiee/javascriptbot

Todo

  • Webhook support (not tested, see #4)
  • Forward Type
  • BulkMessage Type
  • File Type
  • Sticker Type
  • Location Type
  • Contact Type
  • Allow remote control of bots (TCP maybe)
  • YOUR IDEAS! Fill an issue