So I have been working on a Discord bot and trying to get it hosted here, I have had some success, but there are also some bizarre things that are happening.
The problem isn't that I can't get it to work, the issue is that I can't get it to STOP working.
I essentially have one large .py
file that uses discord.py
(which is based off of asyncio
) and when I run that one file through the console, it runs fine. The task eventually dies at somepoint in the future, which I expect because it's just a script. So I can't really do what I want to do with a file/bash console. So far no problems.
My next idea was to host it as a website, in the hopes that it would run longer and I could use the reload
button if it has issues. So I copied and pasted the code into the __init__
file of a new website. This seemed to work fine as the script runs longer and the reload button was working. Then I got some odd results, I would update the code, and would use reload
and I would get a message that said there was an error reloading the web app. It would also not stop the web app from running, meaning I have a website running my code that I have no way of stopping. Eventually it stops, but I have absolutely no control over when or why it stops. I deleted the web app, deleted the directory with the code in it, and the app still runs. As of right now I have 0 running process, 0 web app, 0 consoles, and 2 running discord bots that I can't stop.
Next thing I tried was an Always-On Task, witch sounds almost exactly like what I want to use. With this I have had no success at all. I set up the command to be python3.6 home/ArtificialBadger/DOER.py
which is a link to my main discord bot file. But no matter what, I can't get it to get passed the Starting
phase.
So as far as I can tell, there is no way I can reliably host a Discord bot on here. Anyone else experiance anything similar, or know how to solve any of these issues? I would love to use the Always on Task if possible so I don't have to manually restart.