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
Telegram Bot Now
This project offers a skeleton for easily creating Telegram bots using the Now serverless platform. For more information on Now, see:
Install
The project is available from NPM and can be installed in the usual way:
npm install --save telegram-bot-nowBut to deploy your bot you'll also need the Now client. Install it like this:
$ npm install -g nowUse
To get started create a local link to our maker utility:
ln -s node_modules/telegram-bot-now/mkNow you can grab our sample code:
./mk examplePlease 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:
./mkThe 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 logsTo see other commands supported by the make utility:
./mk --helpAdditional 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.gitSupport
Create a ticket on Github. Reach out to me on Telegram. You'll find me as @ekkis