• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

event.on('clientmove' ... getPlatform and getVersion not working

bky6677

#stayinghome
Hello,

I'm trying get platform and version to connected users. But log is blank. getPlatform and getVersion not working on event.on clientMove.

Code:
event.on('clientMove', function (ev)
    {
        if (ev.fromChannel == undefined)
        {
             engine.log(ev.client.getPlatform());
             engine.log(ev.client.getVersion());
        }
    });
 

flyth

is reticulating splines
Staff member
Developer
Contributor
Those infos are not available when the connect event gets triggered, but shortly afterwards. You can try using setTimeout() with a delay of a second or such. You would then have to refetch the client object, though, using the client's id for example.
 

irgendwr

no longer active, "retired" staff member
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
A possible suggestion would be to wait with firing the event until all client infos are available, but this could have the downside that it adds latency.
 
Top