CatalysmsServerManager / 7-days-to-die-server-manager

A server manager for 7 Days to die
GNU General Public License v3.0
68 stars 59 forks source link

Discord status to show online players #629

Open rjclarkewp007 opened 3 years ago

rjclarkewp007 commented 3 years ago

Add a custom status option to the Discord bot to display the current online players on the server.

niekcandaele commented 3 years ago

So filling this out with some additional info:

There's already some logic for rotating info here: https://github.com/CatalysmsServerManager/7-days-to-die-server-manager/blob/master/api/hooks/discordBot/index.js#L101-L135

First thoughts would be to have an if statement, if it's a selfhosted instance => Get player data continously and update status if not => do the logic that's there now.

You can use the env var CSMM_PRIVATE_INSTANCE for that if check probably. It doesn't 100% mean it's a self hosted instance, but should be close enough