A NodeJS Telegram bot deployed using Pulumi.
- Pulumi configured.
- A Telegram account.
-
Install Pulumi.
-
Install the required dependencies.
npm install
- Build the Lambda functions.
npm run build
-
Create a Telegram bot using @BotFather.
-
Create a new Pulumi stack.
pulumi stack init <stack_name>
- Configure the AWS region you want to deploy into.
pulumi config set aws:region <aws_region>
- Add the Telegram Bot token received as a secret to Pulumi config
pulumi config set tgBotToken <your_token> --secret
- Deploy the application.
pulumi up
- You can check the bot's status with the
/health
endpoint.
curl $(pulumi stack output apiUrl)/health
- Using
set-webhook
endpoint, register the bot's webhook on Telegram
curl -X POST $(pulumi stack output apiUrl)/set-webhook
Now you can /start
a conversation with the bot.
- To delete the project from AWS.
pulumi destroy
- Talk to @BotFather to delete the bot.