I just found Back4App free tier to test my lightweight apps, want to deploy a Telegram bot written with Pyrogram but didn't find any guide on the website for Python app deployment. How can I deploy my app? It doesn't have a database and has only two files main.py and bot.session; also I don't know if I need to set webhook or not. Thanks in advance.
Deploy Telegram Bot (Pyrogram) on Back4App
1.6k Views Asked by Ali Abdi At
1
There are 1 best solutions below
Related Questions in PYTHON-3.X
- SQLAlchemy 2 Can't add additional column when specifying __table__
- Writes to child subprocess.Popen.stdin don't work from within process group?
- Platform Generation for a Sky Hop clone
- What's the best way to breakup a large test in pytest
- chess endgame engine in Python doesn't work perfectly
- Function to create matrix of zeros and ones, with a certain density of ones
- how to create a polars dataframe giving the colum-names from a list
- Django socketio process
- How to decode audio stream using tornado websocket?
- Getting website metadata (Excel VBA/Python)
- How to get text and other elements to display over the Video in Tkinter?
- Tkinter App - My Toplevel window is not appearing. App is stuck in mainloop
- Can I use local resources for mp4 playback?
- How to pass the value of a function of one class to a function of another with the @property decorator
- Python ModuleNotFoundError for command line tools built with setup.py
Related Questions in DEPLOYMENT
- Github Pages Deployment deploys a blank page
- Django Admin Panel and Sub URLs Returning 404 Error on Deployment
- Next 14 App Router pages from dynamic routes not generating when deployed on vercel but only work on localhost
- Deployment through app engine, cloud sql database, problem connecting with server code, doesn't connect
- How to Deploy and Manage a Python Application with Systemd
- Elasticbeanstalk FastAPI application is intermittently not responding to https requests
- Duplicate GET requests - Rails & Heroku
- How to use a proxy to obtain a static IP for my Node.js application?
- Next js app throwing 404 error when deployed to vercel, even though it works fine on local
- How to deploy my shiny application (with multiple files) via Docker
- Deploying telegram bot
- How to deploy angular 17 SSR into IIS
- Route not working on refreshing the page in react deployed application
- Vercel wildcard route's src results in 404 error in Hapi.js backend
- Django deployment with GTK3
Related Questions in BACK4APP
- back4App Parse and NextJS 13 login with next auth
- how we can add expiry to the file_url given by back4app?
- Problem Using Back4App/Parse with React Native (Expo)
- Square In-App Payment Error Do not know how to serialize a BigInt
- Error Installing NPM on Back4App Parse Server For CloudCode
- Can't Compile After Adding Parse
- How to initializeParse in expo router v2 project(using back4app parse server)?
- Environment variables in back4app node container
- Communication with backend through parse doesnt work in build but in dev mode with Quasar and vite
- Problem with Quasar, parse and back4app together with vite
- ReactJS Parse initialisation using Back4App
- Reactjs file uploader to Back4App
- How to fix ' no process is listening to the 443 port using http' while deploying a pyrogram bot to back4app?
- How can I make my back4app app use a custom s3 bucket under my own aws account?
- How do I find the source that is making api calls from my back4app?
Related Questions in PYROGRAM
- Pyrogram: telegram API returns 400: INPUT_FILTER_INVALID after search_messages() request
- Pyrogram RequestPerrButton
- I get an error when using Pyrogram with Threading in Tkinter
- running tkinter and pyrogram together
- How do I mark a voice message as listened to using pyrogram?
- Playwright TypeError: 'function' object does not support the asynchronous context manager protocol
- Pyrogram Userbot command filter doesn't work for valid command
- How i can upload stories in telegram account with pyrogram?
- Do I need to create a separate api_hash and api_id for each, or can I somehow parse messages from multiple users from the same pair of api_hash/id?
- Container Fails to Start After 250 Seconds: How to Troubleshoot and Resolve HTTP Ping Timeout on Port 8000? deploying in Microsoft Azure App Service
- Can't make telegram bot see group chat topics one from another
- Delay between new telegram channel messages and their stored datetime metadata
- How to solve this error its a telegram bot using pyrogram library
- ERROR: Could not build wheels for tgcrypto, which is required to install pyproject.toml-based projects
- The inline keyboard buttons are not displayed in pyrogram
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I'm sure you've already figured it out, but if somebody else wants to know:
First of all, back4app uses (at least now) Docker images to deploy your app. There are simple instructions on the site: https://www.back4app.com/docs-containers/integrate-with-github
Long story short: You need to put your project on GitHub, then integrate it with b4a, then create a Dockerfile* and put it in your project and then pick this project here: https://containers.back4app.com/apps
If you've done everything correctly, your bot will function perfectly. But even if your deployment failed, your bot might still work.
Here is a simplified Dockerfile that is 100% functional:
There is one thing that's need mentioning. If you will use my Dockerfile, back4app would say that deployment failed with this error: "It looks that no process is listening to the 80 port using http". But your bot would still function (if your code does work).
I can't tell how to get rid of that error, but if you need a working app, you could try to solve this mistery later by yourself.
Quote from official Telegram website. "The TCP transport is implemented simply by sending the payloads generated by the chosen MTProto transport over a plain TCP socket on ports 80, 443, 5222 or other (a different port number may be returned by help.getConfig)": https://core.telegram.org/mtproto/transports
*Dockerfile is a file withont extention named "Dockerfile", which containes commands to build your Docker container.
**If you don't know how to create a requirements.txt file, check this link: https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/
Long story short: If you don't want to put EVERY package you have on your computer in your Docker contaner, use virtual invironment to install only needed ones and then use this command: