Jump to content

Recommended Posts

Posted

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:

https://www.helionet.org/index/topic/30316-johnny-python-telegram/

https://www.helionet.org/index/topic/34304-how-to-run-a-python-script/

 

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.

 

Thanks,

Ben

User: barjoman

Server: Tommy

Posted

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

#!/usr/bin/python3.6
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?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...