Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A simple API to create and control Telegram bots

License

NotificationsYou must be signed in to change notification settings

mdibaiee/node-telegram-api

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.

Documentation

Example

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

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

About

A simple API to create and control Telegram bots

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp