Solved How would I connect my discord bot to my plugin?

Discussion in 'Spigot Plugin Development' started by Xurvold, Jun 13, 2021.

  1. I am currently developing a bot which can connect to multiple spigot plugins and vice versa but I am not sure how to achieve this. Running the bot inside the plugin isn't an option because the plugin will run on multiple servers and I only want one bot. Someone came up with the idea to use a database (redis?) or maybe sockets. Would either be a good option or is there something else that I didn't mention but could work better?

    Thanks in advance!
  2. Depends on what you need. If it needs to be somewhat instant (say logging chat to Discord), you could do sockets. If it doesn't need to be instant, using a DB would probably work.

    Depending on your environment, you could consider something like Kafka. It's overkill for what you are describing, but if you have a large network, you could set up a Kafka Producer, and have your Discord bot listen to the feed.
  3. Oke thank you!
    • Agree Agree x 1