JSPM

  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q84946F
  • License ISC

A NodeJs-based Telegram bot for the Now serverless platform

Package Exports

  • telegram-bot-now

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (telegram-bot-now) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

npm version

Telegram Bot Now

This project offers a skeleton for easily creating Telegram bots using the Now serverless platform. For more information on Now, see:

https://zeit.co/now

Install

The project is available from NPM and can be installed in the usual way:

npm install --save telegram-bot-now

But to deploy your bot you'll also need the Now client. Install it like this:

$ npm install -g now

Use

To get started create a local link to our maker utility:

ln -s node_modules/telegram-bot-now/mk

Now you can grab our sample code:

./mk example

Please note: the make utility will not work on Windows. Users of that operating system are encouraged to install Cygwin or another bash shell available

Deploy

To deploy your bot you'll first need to set up your Telegram API key as follows:

./mk secret <your-secret-api-key>

which will upload the key as a secret to the Now environment and display an export statement you can use to initialise your local environment. Without this key the maker utility will not function

After that you can create a Now deployment very simply via the command:

./mk

The above will synchronise the local files in your project with the Now servers and authomatically bind your deployment as a handler to your telegram bot using webhooks. To see logs on the deployment:

./mk logs

To see other commands supported by the make utility:

./mk --help

Additional Reading

For a complete description of how to set up routes, create dialogues, the various utilities provided in the module, and troubleshooting guidance, please read the Medium article:

A Telegram bot in the serverless Now

Contribute

If there's some enhancement you'd like to contribute, please clone the project, modify it and submit a pull request:

$ git clone https://github.com/ekkis/telegram-bot-now.git

Support

Create a ticket on Github. Reach out to me on Telegram. You'll find me as @ekkis