Exiled-Team / DiscordIntegration

GNU General Public License v3.0
13 stars 36 forks source link

Fix, maybe: Channel Update #34

Closed SrLicht closed 3 years ago

SrLicht commented 3 years ago

https://github.com/galaxy119/DiscordIntegration/blob/2a2dbbcafc92f18819688774e2c8372a19cc6336/DiscordIntegration/Plugin.cs#L160

To solve the channel update error, you have to increase the update time simply to 5 minutes or more, since Discord has a ratelimit to update the topics of 2 calls every 10 minutes. I know that showing players every 10 minutes is very stupid, but I could do a counter of rounds, kills or TK, so that the statistics are interesting. On my server I have some counters like that, but I haven't managed to get the statistics to be saved, since surely I have to use litleDB, but I don't know how to use it.

public IEnumerator<float> UpdateStatus()
        {
            for (;;)
            {
                ProcessSTT.SendData($"updateStatus {PlayerManager.players.Count}/{ConfigFile.ServerConfig.GetInt("max_players")}", 0);
                yield return Timing.WaitForSeconds(5f);
            }
        }

image