MyChat Scripts Engine: mGetWebSupportGroupUsers
Get a list of user UINs for a specified group of WEB support operators.
Syntax
function mGetWebSupportGroupUsers(iID: integer): string;
Parameters and return values
Parameter |
Type |
Value |
ilD |
integer |
unique ID of a group of WEB support operators. |
Function result
String with user UINs divided by commas. If a group is empty, the function returns an empty string.
Example
const
GROUP_NAME = 'MyChat Web Support';
var
iID, iUIN: integer;
sUsersList: string;
begin
iID := mGetWebSupportGroupIDByName(GROUP_NAME);
if iID > 0 then begin
sUsersList := mGetWebSupportGroupUsers(iID);
if length(sUsersList) > 0 then begin
while length(sUsersList) > 0 do begin
iUIN := StrToIntDef(Fetch(sUsersList, ','), -1);
if iUIN > 0 then mLogScript('User UIN: ' + IntToStr(iUIN) +
', "' + mGetUserAttribute(iUIN, 'DisplayName') + '"',
'');
end;
end else mLogScript('Web support group "' + GROUP_NAME + '" is empty', '');
end else mLogScript('Web support group "' + GROUP_NAME + '" not found', '');
end.
Script work result
[15:49:29] (Log "mGetWebSupportGroupUsers"): User UIN: 15427, "Heorhii Lysenko"
[15:49:29] (Log "mGetWebSupportGroupUsers"): User UIN: 16222, "Android Dev"
[15:49:29] (Log "mGetWebSupportGroupUsers"): User UIN: 9865, "***maximilian****"
[15:49:29] (Run "mGetWebSupportGroupUsers"): Script operation time: 7 ms
[15:49:29] (Run "mGetWebSupportGroupUsers"): Script done successfully.