Discord-for-TTT2 / dttt

Discord Integration for TTT2!
GNU General Public License v3.0
0 stars 0 forks source link

[FEAT] Change muteAll to send all players at once #5

Closed vertiKarl closed 4 months ago

vertiKarl commented 5 months ago

Is your feature request related to a problem? Please describe. When muting all players in a voice channel, we currently send each player separately. Which in turn triggers the backend to send every player mute to the Discord API separately (which also could trigger ratelimits). This slows down the muting process immensely.

Describe the solution you'd like Send all players to mute at once in an array using a custom HTTP post request. Something like:

POST /mute

[
    {
      "id": "1",
      "status": true
    },
   {
      "id": "2",
      "status": true
    },
    ....
]

Note: using the same route /mute breaks backwards compatibility with current implementations. (easily fixable though)

Describe alternatives you've considered Alternatively we could just use a separate route, e.g. POST /mute-multiple. And if that returns a 404, we just send them separately. (still think solution 1 is better, especially since the only backend implementation up to now, is mine...)

G4PLS commented 4 months ago

Implemented on dev branch