A Telegram bot for announcing free games.
The bot needs some secret tokens:
- The FreeStuff API access token.
- The Telegram bot token.
The secrets can be stored in a simple text file located at the root of the repository.
And for convenience a DOTENV file was used for the job: copy and rename the example.env
file into .env
and then update it's content with the suitable values.
The secrets can be set into environment variables with the same names used in example.env
.
The information is recorded as the dashboard is designed at
2021-11-15
- Connect the git repository to Vercel.
- Go to Settings -> Project Settings.
- Set the root directory to
src
. - Set the Node.js version to
14.x
.
- Set the root directory to
- Go to Settings -> Environment Variables.
- Create each environment variable needed as specified in the
.env
file. - The value shouldn't include any quotes.
- Set the environment to
Production
only.
- Create each environment variable needed as specified in the
- Trigger a deployment by creating a git commit or if it's possible with the dashboard buttons they have.
- Configure the Telegram commands using
npm run configure
. - Configure the Telegram webhook using
npm run set_webhook
. - Configure the FreeStuff webhook in the FreeStuff Dashboard.
- FreeStuff Webhook:
{domain_name}/api/freestuff/{api_token}
- Telegram Webhook:
{domain_name}/api/telegram/{bot_token}