MyChat Scripts Engine: mGetUserGroupsListAsJSON, get user's list of groups
Function to obtain a list of groups that a specified user is a member of.
Syntax
function mGetUserGroupsListAsJSON(iUIN: integer): string;
Parameters and return values
Parameter |
Type |
Value |
iUIN |
integer |
unique user ID, a number is greater than 0. |
Function result
A text string is a JSON array with a list of groups that the specified user is a member of.
If user doesn't exist or doesn't belong to any of groups then an empty array returns ("[]").
Example
const
UIN = 6;
var
sJSON: string;
begin
sJSON := mGetUserGroupsListAsJSON(UIN);
mLogScript('UIN ' + IntToStr(UIN) + ': ' + sJSON, '');
end.
Script work result
[13:51:40] (Log "mGetUserGroupsListAsJSON"): UIN 6: ["auto generated NSS","Test Group","\u0421\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a"]
[13:51:40] (Run "mGetUserGroupsListAsJSON"): Script operation time: 6 ms
[13:51:40] (Run "mGetUserGroupsListAsJSON"): Script done successfully.