Hacker News new | ask | show | jobs
by curryst 2256 days ago
You can certainly run more than one Discord server on a single running instance of the bot. That's probably more code, but you could run the web server as part of the same process. I would generally discourage that though, because then you can have your bots DDoSed by just DDoSing your web server.

The easier incarnation is to store the Discord connection configs in a database. Make a web server and UI to manage the database (the Django admin panel is probably enough, which would make it low code). Then have the web server manage an orchestration layer by pulling configs from the database. The easy solution is probably to have your web server write out supervisord config files templated from the data in the database, and then send reload signals to supervisord. The more difficult option there would be to write your own process management layer (probably not worth it, you're just rewriting supervisord at that point). Or you could maybe just pull in supervisord as a library and use it.

That solution is less resource efficient, but not at a "break the bank" level.

1 comments

Thanks, you've described what I had in my head as a rough way of doing things - the issue with this approach is that it appears to be one bot instance per user. I.e. if I want the same 'user' to be able to be invited to unlimited servers, that 'user' must run from a single application instance - meaning all server chats flow through a single app instance.