• 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.

EN Get user uid with function getChannel

Status
Not open for further replies.

Floflobel

Donor
is awesome!
Contributor
Hi,

How I can get a uid of user with function "sinusbot.getChannel(getCurrentChannelId())"

I try but not work :
sinusbot.getChannel(getCurrentChannelId()).clients.uid

Best regards
 

mxschmitt

Moderator
Staff member
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
So you can get the UID from a user, who send then bot a message:
Code:
sinusbot.on('chat', function(ev) {
// Do something when someone writes to the bot
chatPrivate(ev.client.Id, 'You just said: ' + ev.msg + and have the UID: ' + ev.clientUid
);
});
 

Floflobel

Donor
is awesome!
Contributor
So you can get the UID from a user, who send then bot a message:
Code:
sinusbot.on('chat', function(ev) {
// Do something when someone writes to the bot
chatPrivate(ev.client.Id, 'You just said: ' + ev.msg + and have the UID: ' + ev.clientUid
);
});
Thank's for your reply, but I don't need to use ev function.
I need to get all uid in current channel.
I show all clients in channel with "sinusbot.getChannel(getCurrentChannelId())". But I don't get the array of uid.
 

mxschmitt

Moderator
Staff member
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
Check that out, and figure it out yourself through the log
Code:
sinusbot.log(sinusbot.getChannel(sinusbot.getCurrentChannelId()));
 

Floflobel

Donor
is awesome!
Contributor
I understand, but I can't get the uid of clients.
I try :
sinusbot.log(sinusbot.getChannel(sinusbot.getCurrentChannelId()).clients.uid);
or
sinusbot.log(sinusbot.getChannel(sinusbot.getCurrentChannelId()).clients[0].uid);

Code:
{
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "clients": [
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]     {
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "away": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "dbId": 65,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "g": [],
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "id": 25,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "idle": -1,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "inputMuted": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "ko": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "nick": "▄ █ ▌▄ █ MUSIC 2 ▄ █ ▌▄ █",
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "outputMuted": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "outputOnlyMuted": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "recording": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "uid": "TFTxHjEhy1CBx79CX4tZgtHVNWA="
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]     },
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]     {
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "away": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "dbId": 221,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "g": [],
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "id": 27,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "idle": -1,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "inputMuted": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "ko": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "nick": "TyZze_",
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "outputMuted": 1,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "outputOnlyMuted": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "recording": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]       "uid": "BrhSocsULDCyOM0oldJl7dAIGSA="
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]     }
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   ],
"codec": 5,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "default": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "enc": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "id": 203,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "maxClients": -1,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "name": "Public \u0026 Calme I",
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "order": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "parent": 201,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "perm": 1,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "pw": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "quality": 10,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "sperm": 0,
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "topic": "",
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault]   "unlimited": true
2016/10/24 15:57:20 1aff5687 9e26bfe0 PLUGIN [backtodefault] }
 

mxschmitt

Moderator
Staff member
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
try:
Code:
sinusbot.log(sinusbot.getChannel(sinusbot.getCurrentChannelId())['clients'][0]['uid']);
 
Status
Not open for further replies.
Top