Forums

Can't make python code automate discord bot

I have a discord bot with a python code, which checks for changes on a website, and if there is, it sends a notification with specific role pings. However only in pythonanywhere it does not work. I installed the discord plugin. The problem seems to be that discord refuses the connection with pythonanywhere.

Unfortunately Discord won't work in a free account on PythonAnywhere. Free accounts have to use a proxy to access the public Internet. That proxy is what restricts the sites you can access to those on our allowlist. Now, Discord is on the allowlist -- it's exactly the kind of public API that should be there -- but unfortunately the Discord API library can't handle proxies, so it tries to connect directly to their servers, and you get the error that you're seeing.

So if i pay for the Hacker plan it works?

Yes, it should work (unless there are other unrelated problems)