MyChat Scripts Engine: mIsUserTeamLead, check if a user is a department's cheif
Function to determine if a user is the chief of the department.
Syntax
function mIsUserTeamLead(iUIN: integer): boolean;
Parameters and return values
Parameter |
Type |
Value |
iUIN |
integer |
unique user identifier. |
Function result
True, if the user is the chief of the department, False if not or such UIN does not exist on the server.
Example
const
iUIN = 3;
var
s: string;
begin
if mIsUserTeamLead(iUIN) then s := 'is team leader.' else s := 'isn''t team leader.';
s := mGetUserAttribute(iUIN, 'DisplayName') + ' ' + s;
mLogScript(s, 'INFO');
end.
Script work result
[13:28:35] (Log "TestTeamLead"): [INFO] John Smith is team leader.
[13:28:35] (Run "TestTeamLead"): Script operation time: 2 ms
[13:28:35] (Run "TestTeamLead"): Script done successfully.
See also
Created with the Personal Edition of HelpNDoc: Create Professional CHM Help Files with HelpNDoc's Easy-to-Use Tool