The online racing simulator
Number of players displayed in Discord.
Hello. We have the official lfs server. We were able to transfer the game chat to discord because we had some in-server problems. But we want to see how many people are on the server before they enter the game. Can anyone help on this issue? We want to see how many people are on the server from Discord. LFS

Edit: [Bass-Driver] Changed topic title.
** Best answer **
Try the next line of code.
Add that line inside the OnConnect and OnDisconnect event.

You will see that the botstatus goes to: Playing: <numofplayers> Players

setconfigvar("DiscordBotStatus",":".GetLapperVar("numplayers")." Players"); #change discordbot statusmessage


<?php 
Event OnConnect
$userName # Player event

    
setconfigvar("DiscordBotStatus",":".GetLapperVar("numplayers")." Players"); #change discordbot statusmessage

EndEvent

Event OnDisConnect
$userName$reason # Player event

    
setconfigvar("DiscordBotStatus",":".GetLapperVar("numplayers")." Players"); #change discordbot statusmessage
  
EndEvent
?>


Thanks. You know this job.
Quote :You will see that the botstatus goes to: Playing: <numofplayers> Players

Is it possible change status "Playing:" something else or empty? Like live streaming, for example.
Not sure if thats possible within the discordbot. Because i do not send any text to the discordbot like "Playing:"
Need to look into their library to see if thats possible.
This thread is closed

FGED GREDG RDFGDR GSFDG