zfbx / zdiscord

A Discord bot that runs in FiveM for the purpose of whitelisting, moderation and utilties using discord.js
Other
211 stars 79 forks source link

[Feature] Persistent player count channel #42

Closed napei closed 2 years ago

napei commented 2 years ago

Would be nice to have a persistent locked voice channel in the server, that updates every second or so with the online player count. A lot of other bots do this with discord member counts. Potentially this could also be dynamic like the status messages.

Format could be: Players Online: {playercount}

Example: image

zfbx commented 2 years ago

That's actually extremely easy to do with an addon module, I'll throw one together real quick as an example

zfbx commented 2 years ago

https://github.com/zfbx/zdiscord/commit/3f3c11ca2d7bbf854d7db1bc0ffbe2f348a5d18e there you go, just drop that in your server/addons folder with the channel id you want updated and it'll do exactly like you suggested

napei commented 2 years ago

3f3c11c there you go, just drop that in your server/addons folder with the channel id you want updated and it'll do exactly like you suggested

That's awesome, thank you for that. Is zdiscord:ready not implemented or do I need to raise that myself. I can't find any other references to it (not working as that event isn't called).

zfbx commented 2 years ago

that was added in this commit https://github.com/zfbx/zdiscord/commit/f47074d8d9cccffbe67a9cc038b038aae5c47462

napei commented 2 years ago

Ah I see. Not in the latest release.

Is it in a safe state to use djs instead of a release?

zfbx commented 2 years ago

Ohh yes sorry, I haven't built a release in a little bit, yes the main branch is always stable. I'll get a release built also

napei commented 2 years ago

Awesome. Thanks :)

napei commented 2 years ago

Thanks for that. All working now 😄 https://github.com/zfbx/zdiscord/releases/tag/v7.1.0

napei commented 2 years ago

@zfbx just a PSA, apparently there is a very strong rate limit on channel name changes.

https://discord.com/channels/613425648685547541/697138785317814292/715995470048264233

image

zfbx commented 2 years ago

Oh damn.. well figured they'd do that eventually.. that's brutal though 10 whole minutes.. used to be way less, guess people abused it too much :( that's unfortunate. if desired could do the same with editing a message in a channel

zfbx commented 2 years ago

Pushed a hotfix and updated the release download so other's don't run into that, thank you very much for pointing that out ❤️