A Telegram bot to explore the Stack Exchange API. Built with Claudia.js.
Create a new bot by talking to BotFather and following a few simple steps. You will get an authorization token.
Claudia.js v.5.10.0+ deploys your lambda on AWS Lambda and configures it to be executed on a Node.js 12.x
environment.
When testing your lambda locally, be sure to use the same Node.js version. I included a .nvmrc
file in the repo, so if you use nvm you just have to type:
nvm use
Since this project includes a .nvmrc
file, the same Node.js version will be used on Travis CI.
Install both production and development dependencies:
yarn
The first time you deploy your bot, you will need to create an API on AWS API Gateway, create a lambda on AWS Lambda, create a security role on AWS Identity and Access Management (IAM), setup policies for your lambda to use other AWS services such as S3 or DynamoDB.
You can do all of the above with this command:
yarn bot:create
Now that the bot is deployed on AWS, you need to configure it with the authorization token
that BotFather gave you.
yarn bot:configure-telegram # type access token when prompted
Whenever you want to deploy a new version of the bot, run one of these commands:
yarn bot:update:dev # development
yarn bot:update:prod && yarn api:release # production
Note: You can invoke npm Task List with: yarn menu
to avoid typing the commands.
At the moment claudia-api-builder and claudia-bot-builder don't ship their type definitions. I included some type definitions in the @types
directory. They are ok for the current needs of this project, but they are incomplete. Don't rely on them too much.