Difference between revisions of "Bot Playground/Commands/name2key"
From SmartBots Developers Docs
(Created page with "{{DISPLAYTITLE:{{SUBPAGENAME}}}} <onlyinclude>Converts given resident name to UUID.</onlyinclude> <syntaxhighlight lang="javascript"> Bot.name2key(slname); </syntaxhighlight>...") |
|||
Line 13: | Line 13: | ||
{{API Variable Group|Output}} | {{API Variable Group|Output}} | ||
− | {{API Return | + | {{API Return promise}} |
{{API Variable|slkey}} The UUID of the avatar | {{API Variable|slkey}} The UUID of the avatar | ||
Revision as of 06:56, 29 June 2016
Converts given resident name to UUID.
Bot.name2key(slname);
Reference
This command accepts the following parameters:
Variable | Required | Description
| |
---|---|---|---|
Input: | |||
slname | yes | The name of the resident. Template:Full name required | |
Output: | |||
Function returns a Promise with the following data: | |||
success | bool | true if command completed successfully | |
error | string | error string if command has failed | |
slkey | The UUID of the avatar |
Examples
var slname = "Glaznah Gassner";
Bot.name2key(slname)
.then(function(result) {
if(result.success) {
console.log("The UUID of " + slname + " is ", result.slkey);
} else {
console.log("Error executing name2key: " + result.error);
}
});