MyChat Scripts Engine: mDeleteUserFromWebSupport
Delete a user from a group of WEB support operators.
Syntax
function mDeleteUserFromWebSupport(iUIN: integer): integer;
Parameters and return values
Parameter |
Type |
Value |
iUIN |
integer |
unique user ID. |
Function result
0 |
function executed successfully, a user deleted from a WEB support group; |
-1 |
user with such UIN is not registered on the server; |
-2 |
user is not included to any of WEB support operators group; |
-3 |
built-in bot with UIN=0 is not included to any of WEB support group. |
Example
const
GROUP_NAME = 'MyChat Web Support';
USER = 12;
var
iID, x: integer;
s: string;
begin
iID := mGetWebSupportGroupIDByName(GROUP_NAME);
if iID > 0 then begin
x := mDeleteUserFromWebSupport(USER);
case x of
0: s := 'User removed successfully from web support operators list';
-1: s := 'User with UIN ' + IntToStr(USER) + ' not found';
-2: s := 'User with UIN ' + IntToStr(USER) + ' is not web operator';
-3: s := 'Don''t touch the robot! 8-[]';
end;
end else s := 'Something went wrong :)';
mLogScript(s, '');
end.
Script work result
[18:02:09] (Log "mDeleteUserFromWebSupport"): User with UIN 12 not found
[18:02:09] (Run "mDeleteUserFromWebSupport"): Script operation time: 6 ms
[18:02:09] (Run "mDeleteUserFromWebSupport"): Script done successfully.