by iDemonix on 4/12/20, 11:39 PM with 10 comments
I wrote a simple chat bot to manage xp/levels/roles, amongst various other things, in a Discord server for a popular community. I've since used the same bot in other communities, but it just runs as a clone of a Python repo for each bot, using supervisord on a Digital Ocean VPS. Each bot also has its own developer 'app' within the Discord environment and associated tokens, which is getting cumbersome to manage.
As I've got time to focus on it, I'd like to create a singular bot, with a web UI to manage it, with a very long term end goal of maybe competing with other services like Mee6, but a shorter term goal of making it easy for me to easily add the bot to new communities and configure it - without config + manual steps over SSH.
It's quite niche, but if anyone has any similar experience, I'd be eager to hear any opinions. For example: My first instinct based upon my work experience was a Docker container per bot, but from testing, as far as I can see I need a single instance which handles all servers if I want to use one developer 'app' like Mee6 or Dyno.
Any hints/links or similar welcome.
by caryd on 4/12/20, 11:48 PM
Seems like your current bot would be fine in multiple servers if you added an additional server argument to each of the i/o's.
Don't overthink it.
by curryst on 4/14/20, 2:53 AM
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.
by drzel on 4/13/20, 2:15 AM
by based2 on 4/13/20, 8:50 AM
by Axsuul on 4/13/20, 2:43 AM
by babuloseo on 4/14/20, 1:46 AM