- Notifications
You must be signed in to change notification settings - Fork21
A simple API to create and control Telegram bots
License
NotificationsYou must be signed in to change notification settings
mdibaiee/node-telegram-api
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Create and controlTelegram bots easilyusing the newTelegram API.
npm install telegram-api
telegram-api is in beta, your feedback is appreciated, pleasefill an issuefor any bugs you find or any suggestions you have.
If you are cloning this repository, remember to runnpm install
to install dependencies.
If you are looking for a real-life example of a bot written using this module, seemdibaiee/webdevrobot.
// ES6:importBot,{Message,File}from'telegram-api';// ES5:varBot=require('telegram-api').default;varMessage=require('telegram-api/types/Message');varFile=require('telegram-api/types/File');varbot=newBot({token:'YOUR_TOKEN'});bot.start();bot.get(/Hi|Hey|Hello|Yo/,function(message){varanswer=newMessage().text('Hello, Sir').to(message.chat.id);bot.send(answer);});bot.command('start',function(message){varwelcome=newFile().file('./some_photo.png').caption('Welcome').to(message.chat.id);bot.send(welcome);});// Arguments, see: https://github.com/mdibaiee/node-telegram-api/wiki/Commandsbot.command('weather <city> [date]',function(message){console.log(message.args.city,message.args.date);})
- 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