MyChat Scripts Engine: mGetUserAttribute, get a user's attribute
Function to obtain any field from the user's profile by his attribute.
Syntax
function mGetUserAttribute(iUIN: integer; sAttributeName: string): string;
Parameters and return values
Parameter |
Type |
Value |
iUIN |
integer |
unique user identifier; |
sAttributeName |
string |
name of the attribute from the profile, that you need to obtain. You can specify only one attribute. |
List of user available fields
Name |
Description |
Avatar |
user's avatar number; |
Tag |
text tag, special filed, can be edited or read by MSL; |
UserDomainName |
user's domain name; |
DomainUserRegisteredTime |
date and time of the domain user registration; |
DomainUserLastChangeTime |
date and time of the last modification of the domain user profile; |
InternalNickName |
user's nickname. If it is a domain user then it is his domain name; |
DisplayName |
user's display name. Style can be configured on the server; |
Active |
active or blocked user's account; |
FirstName |
real user name; |
MiddleName |
user's middle name; |
LastName |
user's last name; |
Registered |
date and time of the account creation; |
Role |
name of the user's rights group; |
Home_MaritalStatus |
marital status: -1 — unspecified; 1 — in a relationship; 2 — widowed; 3 — married; 4 — engaged; 5 — divorced; 6 — separated; 7 — unmarried; |
Home_Phone |
home phone; |
Home_Fax |
home fax; |
Home_Birthday |
date of birth; |
Home_Birthday_Without_Year |
date of birth without year (only day and month); |
|
main email; |
Home_Cellular |
personal mobile number; |
Home_StreetAddress |
home address; |
Home_City |
home city; |
Home_State |
state/province/region/district; |
Home_ZIP |
home ZIP code; |
Home_Country |
home country; |
Home_WWW |
personal WEB page; |
Work_DivDept |
work department; |
Work_Position |
work position; |
Work_CompanyName |
company name; |
Work_Office |
work office; |
Work_Phone |
work phone; |
Work_Fax |
work fax; |
Work_Pager |
work pager of messenger number; |
Work_StreetAddress |
work address; |
Work_City |
work city; |
Work_State |
work state/province/region/district; |
Work_ZIP |
work ZIP code; |
Work_Country |
work country; |
Work_WWW |
work WEB page; |
Spoken_Lang_1 |
language spoken, number 1; |
Spoken_Lang_2 |
language spoken, number 2; |
Spoken_Lang_3 |
language spoken, number 3; |
Interest_Section_1 |
interests, number 1; |
Interest_Words_1 |
interests section, key words, number 1; |
Interest_Section_2 |
interests section, number 2; |
Interest_Words_2 |
interests section, key words,number 2; |
Interest_Section_3 |
interests section, number 3; |
Interest_Words_3 |
interests section, key words, number 3; |
Interest_Section_4 |
interests section, number 4; |
Interest_Words_4 |
interests section, key words, number 4; |
History_Section_1 |
type of former employment or study, number 1; |
History_Words_1 |
type of former employment or study, key words number 1; |
History_Section_2 |
type of former employment or study, number 2; |
History_Words_2 |
type of former employment or study, key words number2; |
History_Section_3 |
type of former employment or study, number 3; |
History_Words_3 |
type of former employment or study, key words number 3; |
Past_Organization_1 |
organization type, former employment, number 1; |
Past_Organization_Words_1 |
organization type, former employment, key words number 1; |
Past_Organization_2 |
organization type, former employment, number 2; |
Past_Organization_Words_2 |
organization type, former employment, key words number 2; |
Past_Organization_3 |
organization type, former employment, number 3; |
Past_Organization_Words_3 |
organization type, former employment, key words number 3; |
Sex |
user's gender: 0 — unspecified, 1 — male, 2 — female; |
AuthType |
type of client authentication: 0 — default, 1 — Active Directory, 2 — without a password, 3 — Transparent AD; |
FotoCRC32 |
user's CRC32 photos; |
LastAccess |
date and time of the last access to the server; |
LastSpeakTime |
date and time of the last sent message; |
Custom_1 |
text custom field number 1; |
Custom_2 |
text custom field number 2; |
Custom_3 |
text custom field number 3; |
OfflineFilesExists |
offline file existence for the user; |
State |
current user's network status; |
FavoriteChannelsExists |
check user's favorite text conferences; |
UnreadedBroadcastsExists |
availability of unread notifications; |
OfflineMessagesExists |
availability of offline messages that were not received; |
Hello_Message |
greeting message, if available. Displays to all users, who opened the private chat with this person; |
Autoreplay_Message |
auto-reply message; |
Autoreplay |
enabled or disabled answerphone (1 enabled, 0 disabled); |
Reputation |
user's reputation, number; |
About |
information field "About user"; |
SessionID |
custom field, unique string to authorize from external services; |
AuthService |
custom field, the name of external service, from which the user authorizes; |
Function result
Text string, user's attribute properties. If the user is not found or the information is not filled, returns an empty string.
Example
var
sNick, sDisplayName: string;
begin
sNick := mGetUserAttribute(6, 'InternalNickName');
sDisplayName := mGetUserAttribute(6, 'DisplayName');
mLogScript(sNick, 'Nick');
mLogScript(sDisplayName, 'Real name');
end.
Script work result
[15:29:11] (Log "mGetUserAttribute"): [Nick] (Hobit)
[15:29:11] (Log "mGetUserAttribute"): [Real name] Alexey Pikurov