Question

Using the App platform to host a Discord Bot

I’ve set up a basic Discord PyCord bot using a github repo that contains a requirements.txt, my bot.py, and one single cog called admin.py which is loaded when the bot starts.

Using the App platform, this code is deployed with the Run Command “python3 bot.py”. When the platform attempts to actually run this code the logs show that the bot successfully connects and all seems well, but then I am informed the Deployment Failed and am left without an error message or any idea of what went wrong.

Anyone have any clue how to get this to work? I assume this has something to do with health checks but have no leads.


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
February 15, 2023

Hi there,

It sounds like that the App Platform Health check is failing. What you could do is to use a worker component rather than a web component so that the App Platform would not look for a HTTP health check endpoint.

https://docs.digitalocean.com/products/app-platform/how-to/manage-workers/

Let me know how it goes!

Best,

Bobby

It turns out you have to select a service instance of type “Worker” and not “Web”, then it will work as you expect.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.