I’m making a discord bot and looking to run it 24/7. Is Cloudflare a good place to do this?
It’s a small bot in just a few servers. Can I run it 24:7 on cloud flare? And what would it cost?
11 Replies
Feedback
Feedback has been submitted! Thank you :)
For a bot with slash commands/interactions, sure you can run it on Cloudflare, they work well.
For a gateway/websocket bot, largely not a good idea/makes more sense to run it elsewhere.
Is it possible to keep a bot running 24/7 on the workers free plan?
Slash commands/interactions bot, or a gateway/websocket connected bot?
Slash commands
Slash commands setup via outgoing websockets/HTTP invoke your app with a single request with each usage of them. Workers free gets 100k requests/day (so 100k invocations)
https://discord.com/developers/docs/tutorials/hosting-on-cloudflare-workers
So will it just stay up as long as that limit isn't reached? i don't think it will hit that limit, but what happens if it does?
Worker would respond with errors and interactions/command executions would fail.
https://developers.cloudflare.com/workers/platform/pricing/
When i try to build, it gets stuck at the deploy step. While it's stuck, the bot works. However, after about half an hour, it will quit, and the build fails. The log has no messages after the bot logs in

lol, you're running the bot inside of the build container
it's supposed to be used to just make a worker and then deploy it to the edge
What kind of setup are you using? using discord.js?
Yea discord.js