MyChat Scripts Engine: mAddUserToWebSupportGroup
Add a user to a group of WEB support operators.
Syntax
function mAddUserToWebSupportGroup(iUIN, iID: integer): integer;
Parameters and return values
Parameter |
Type |
Value |
iUIN |
integer |
unique user identifier; |
iID |
integer |
WEB support group identifier. |
Function result
0, function executed successfully
-1, such WEB support group with the specified ID does not exist;
-2, user with such UIN is not registered on the server;
-3, you can't add the built-in bot with UIN=0;
>0 user is already in the WEB support group. Group ID = function result.
Example
const
USER = 6;
ID = 1;
var
x: integer;
s: string;
begin
x := mAddUserToWebSupportGroup(USER, ID);
case x of
0: s := 'All ok, user added to the web support group succesfully';
-1: s := 'Unknown group ID';
-2: s := 'Unknown user';
-3: s := 'You can''t add internal robot to web support group';
else s := 'User is already in the web support group ID: ' + IntToStr(x);
end;
mLogScript(s, '');
end.
Script work result
[19:55:45] (Log "mAddUserToWebSupportGroup"): User is already in the web support group ID: 2
[19:55:45] (Run "mAddUserToWebSupportGroup"): Script operation time: 7 ms
[19:55:45] (Run "mAddUserToWebSupportGroup"): Script done successfully.