How to bypass telegram bot 50 MB file limit
Introduction
I was configuring a CI pipeline with fastlane to my Android project. The idea is to build the app from the repository using the fastlane, publishing it to internal testing and sending the signed apk to our telegram group.
I have done everything correctly, and the pipeline worked. However, there was one limitation. Telegram bots can only send up to 50 MB files, which is in my case unacceptable. My apk is more than 100 MB.
Approach
The solution to the problem is so simple, and it is declared in the official telegram git repository.
You need to build the code on your own, and deploy it to your server. You can see more info at https://github.com/tdlib/telegram-bot-api
In my case, I used my own Google Cloud E2 Virtual machine to deploy the code. However, building the code in the repo required more computational power than I thought. So, my virtual machine simply could not do it.
Then, I started looking for pre-built binaries of the repository, and found one docker container. Fortunately, it contains all the pre-built binaries and I did not have to build the code on my own.
How I did it:
- Installed the docker (reference)
- Created docker configuration as below (in folder telegram):
- Just run the docker image. That’s it
4. And do not forget to run ‘https://api.telegram.org/bot{your_token}/logout’ before using the bot on your new server
## Conclusion
It might be a simple work. But, along the way I learned how to efficiently work with Google Cloud VMs, how to reduce computational cost (when i am building binaries I used E2 medium VM, with docker E2-Small was enough). And, more importantly, how to bypass telegram limitation.
Thank you for reading.