1.19 How to send command on behalf of plugin from web user

Discussion in 'Spigot Plugin Development' started by DragonismPlugins, Jun 23, 2022 at 10:20 PM.

  1. So I'm making a Twitch extension that allows a streamer to accept someone's whitelist request and then they get whitelisted to the server. How would I execute the whitelist command. I was thinking of spinning up a web server and on a request to an endpoint (lets say, /wlplayer), it'll execute the command.

    I feel like hosting a whole web server for this will be too resource-intensive. Is there a better way of implementing this?
     
  2. In general, having your own webserver is going to be the best way for something like that, since you can set up your own security measures.

    The only alternative I can think of is (assuming Twitch API allows for this) your plugin actually reading the chat (every second?) and executing the command if the user is whitelisted.
     
  3. Strahan

    Benefactor

    A purpose built web server isn't very resource intensive. Just be sure to pare it down to the essentials.
     
    • Agree Agree x 1
  4. He means when something on twitch happens like someone types "!whitelist {a minecraft username}" in the twitch chat the server console would execute "whitelist {the minecraft username}"
     
  5. However you implement the communication, I do recommend that you create an endpoint that can only whitelist people instead of creating one that can execute any command.
     
    • Agree Agree x 1