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
- Update a text file with ( new words+ \n ) after the words is appended into a list
- Kivy - Create new widget and set its position and size
- TypeError: encoding or errors without a string argument
- How to print varible name in python
- PyQt, Python 3: Lambda slot assigning signal argument to a variable?
- How to write data to stdin of the first process in a Python shell pipeline?
- pygame.draw.circle, still draws a square
- Duplicate Frames Created When Calling a Function in a Tkinter Application
- Python TypeError: can only concatenate tuple (not "int") to tuple
- recursively editing member variable: All instances have same value
- missing 1 required positional argument: 'key'
- How do I fix this sorting error?
- Dictionary values missing
- Why does opening a file in two different encodings work as expected?
- Binary bit flip generator in python
Related Questions in DEPLOYMENT
- Can I deploy multiple instances of my application on the same windows phone?
- Deploy enterprise (in-house) application on windows phone without developer unlocking the phone?
- uninitialized constant ActiveMerchant::Billing::CreditCard::Validateable (NameError) - in Spree shop
- How to Continuously Develop and Deploy an Access 2010 Database Application
- Efficient way of organizaing mail sending from Rails app
- Deployment over GPRS to embedded devices
- Weblogic 12c web application not start properly after server reboot
- Deployment in Weblogic 10.3, how to change properties
- Deployed Version of MVC Site Not Working
- Laravel 5 on shared hosting getting internal server error
- Integration between Java Applets and .Net dll
- Capistrano Rails deploy with new migration files
- EF Code First - Multiple Application Versions Sharing A Database
- Docker: How to create a stack, multiple images or one base image?
- Slow wpf startup due to publish policy... maybe
Related Questions in BACK4APP
- 401 unauthorized error while creating object in back4app via Temboo
- From parse server to local sqlite (Swift 3)
- Retrieving an array from Parse.com
- unable to connect to back4app using parse4cn1 lib
- Streaming audio from parse in Swift 3
- Deploy - Web page code - Back4app
- Parse server - Parse.User.become(sessionToken) - Invalid Session
- Subscribe to an audience with Parse Dashboard
- Parse Javascript and Cloud Code
- Parse anonymous login (Guest user)
- New to Parse Platform: Question on getting objectId of a relation
- Flutter Parse Server Sdk not saving the second object in the table (class)
- Back4app uploading object issue
- How PWA works with Back4app
- Call cloud code without logged in user Parse Server JS SDK
Related Questions in PYROGRAM
- How to delete all messages in a telegram conversation except the pinned pyrogram?
- Pyrogram user-bot does not output message from telegram, why?
- pyfork send_photo trouble [400 FILE_REFERENCE_EXPIRED]
- How I can convert TDlib to Telethon sessions
- Create Telegram Group Topic using api or Pyrogram
- Can't add an inline keyboard to a user bot message
- Pyrogram how to log out of a private channel by id?
- How to query the all time high market cap for an ERC20 contract?
- Issue with Pyrogram in Developing a Telegram API Bot
- How to launch and proper operation of Pyrogram and Aiogram
- Pyrogram "sqlite3.OperationalError: database is locked". How to assure messages will be delivered?
- How to make pyrogram download file faster?
- pyrogram - Telegram API to get live location update
- Avoid FloodWait in python
- Deploy Telegram Bot (Pyrogram) on Back4App
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 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: