Jump to content

Running a Python Telegram Bot


Recommended Posts

Hi. I apologize in advance as I'm completely new to this. I've written a functioning Telegram Bot using the python-telegram-bot wrapper (https://pypi.org/project/python-telegram-bot/)


Searching through the forums, I've found a few posts with some hints about how to get the bot to run:




Unfortunately, I'm still not clear on how to get this to work. Here is what I've tried:

I've created a file in the cgi-bin folder through cpanel called testbot.py into which I've copied my code. I've also added "#!/usr/bin/python3.6" to the top

However, going to http://barjoman.heliohost.org/cgi-bin/testbot.py gives me a 500 error:




Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@barjoman.heliohost.org to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.




I was also unable to get it to run through a cronjob, although I'm guessing this is because of the error above.


If anyone can assist, it would be appreciated.




User: barjoman

Server: Tommy

Link to comment
Share on other sites

So I played around a bit more and I was able to get the following script to run:

print("Content-Type: text/html\n\n")
print("Hello World!")

Something else that I noticed in case it applies to anyone else is that if you are using sqlite, it has to have the .sqlite3 extension. I was previously using a .db extension on my local machine and it worked fine, but it wouldn't work on HelioHost.


Having said all of this, I'm still not able to get my bot to run. I'm assuming this is because python-telegram-bot is not installed. Would someone be able to help me out with installing this?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...