GithubHelp home page GithubHelp logo

Comments (4)

Neko-Life avatar Neko-Life commented on September 15, 2024

second approach sounds better to me than having master slave relationship. I think this can be implemented with REST adding endpoints to the api, or socket for faster response time. The config can contain a list of bot domain uri where each bot can connect to, so when any instance of the same bot got a command it will behave consistently based on its situation. Although such small feature with a lot of work to solve user laziness. Searching for unused instance of one of your bot won't be too hard is it?

from discord-musicbot.

BioCla avatar BioCla commented on September 15, 2024

I think implementing a sort of mesh network topology might be the best approach, at least theoretically, it would allow for each bot to communicate with each other without a single point of failure in case one of them goes down.
This isn't considering the actual implementation aspects of the whole ordeal, since deploying such a thing in a doable and easy manner, so as to not have our support channels clogged, might be a bit difficult
https://en.m.wikipedia.org/wiki/Network_topology

This might be somewhat doable using docker scaling, allocating a single env.secrets file to hold a multitude of configurations for each bot you'd like to deploy, a parsing script for validity and integrity check and then having the bot, on startup, check by itself which id are not yet taken, Picking the first one available. This way you can use the --scale flag from compose to run the same bot n times and they'd be ready to run with their dedicated configurations

This also doesn't consider the cases and the logic for when bots of the same type aren't in the same server.
Example:
Bot A is in server A, but Bot B isn't. The case explained in the OP would mean it throws an error cause Bot B doesn't have access to the server;
Instead, Bot A should send a message saying "I'm already occupied, invite Bot B if you want more bots..."

from discord-musicbot.

elBelgg avatar elBelgg commented on September 15, 2024

Another option could be that all the bots have access to a local database in which the bots will say when they join a channel, in which channel and when they leave that channel. In this way, if Bot B sees that Bot A is already in a room and that a user in another channel calls the Bot, B will be able to go. I think it could be done with SqLite and a couple of scripts.

from discord-musicbot.

BioCla avatar BioCla commented on September 15, 2024

Another option could be that all the bots have access to a local database in which the bots will say when they join a channel, in which channel and when they leave that channel. In this way, if Bot B sees that Bot A is already in a room and that a user in another channel calls the Bot, B will be able to go. I think it could be done with SqLite and a couple of scripts.

This is not a viable solution as it could lead to transaction failures. It'd be the typical semaphore problem causing locks

from discord-musicbot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.