Skip to content

Latest commit

 

History

History
 
 

azure-node-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Azure Node Telegram Bot

This example of telegram bot using Azure Function with Serverless Framework.

Usage

Required

  • Node.js v6.5.0 or later
  • Telegram account 📱
  • Azure Account. check this link about azure credentials.

Get started

  1. Clone the ripo and install dependencies
# Clone the repo
$ git clone [email protected]:serverless/examples.git/azure-node-simple-http-endpoint
$ cd example/azure-node-telegram-bot

# Install the Serverless Framework
$ npm install serverless -g

# Install the necessary plugins
$ npm install
  1. Create a bot from Telegram, sending this message to @BotFather
$ /newbot
  1. Put the token received into a file called handle.js.
const token = "YOUR_API_TOKEN";
  1. Deploy it!
$ serverless deploy
  1. Configure webhook
curl --request POST --url https://api.telegram.org/bot{token}/setWebhook --header 'content-type: application/json' --data '{"url": "{end-poinnt}"}'

Say hello to your bot 🤖