- Have node 16 (preferably install and use
nvm[node version manager])
- Search
Bot Fatheron telegram, create your bot, copy the token you get - Modify
functions/src/index.tsand put your token at thetokenvar - Run
cd functionsandnpm ito install dependencies - Go to https://firebase.google.com, create a project
- Upgrade the project to the pay-as-you-go plan (that's free for this use case, just add a CC)
- Go to the
FireStoresection and set it up to use in europe somewhere - open
.firebasercfile and put your project-id there (no spaces, it's the name you gave your project) - Install firebase-tools with
npm install -g firebase-toolsand runfirebase login, then after you log in, runfirebase deploy --only functionsto deploy your project
You can also test it using npm run serve, then go to the url displayed in the console to start the process
- Look for the bot you created in Telegram, send him a message
- Open Telegram in the browser, go to your conversation with the bot, copy the chat id from the url (it's the number at the end)
- Open
functions/src/index.tsand put your chat id in the chatId var