Delphi Reads Telegram Bot powers creation of Delphi Reads items by Delphi research analysts
Install deps
npm i
Generate your telegram bot for local dev.
Create a smee channel to proxy webhook requests to your local server. Copy
the generated smee channel url as you'll need to save it as DELPHI_READS_WEBHOOK_URL
in your
.env
file.
Copy .env.template
to .env
file:
cp .env.template .env
Open .env
and populate values.
Start the server in dev mode:
npm run start:dev
Dev mode will automatically configure smee to proxy requests to your local server.
To simulate hitting the live endpoints to create a Read or an AF post, temporarily update fetch calls to use URLs with:
http://localhost:5555/af
http://localhost:5555/reads
Use BotFather to set commands for your bot.
- In conversation with BotFather:
/setcommands
-
Then, select the bot to set commands for
-
Finally, add all your commands. Below could be used for the Delphi Reads bot:
menu - Display the main menu
newread - Create a new Delphi Read item
newafpost - Create a new AF post
help - Get help or provide feedback
# deploy to beta/staging environment
npm run deploy
# deploy to prod
npm run deploy:prod