cb.getRoomUsersData(func)¶
Get information of room users. The funcargument should be a function that receives 1 argument itself, usersData.
The userData variable passed to the function has a array of these fields:
success: did the request succeed
errorMessage: error message if success=false
- data:
room_owner: array with the name of the room owner
moderator: array of room moderators
fanclub: array of fan club members
dark_purple: array of users with dark purple chat color
light_purple: array of users with light purple chat color
dark_blue: array of users with dark blue chat color
light_blue: array of users with light blue chat color
grey: array of users with grey chat color
Note: This call is executed asynchronously and the code continues to run in the background.Once the information is received, the callback code will be executed with requested data.
Example Usage¶
cb.getRoomUsersData(usersData => { if (usersData['success']) { for (user of usersData['data']['fanclub']) { cb.sendNotice(user + ' is a fan club member!') } }});Example Output¶
Notice: testuser is a fan club member!Notice: testuser2 is a fan club member!