name2key

From SmartBots Developers Docs
Bot PlaygroundCommands
Revision as of 06:33, 2 November 2016 by Gg (Talk | contribs)

Jump to: navigation, search

Returns the UUID of the given resident by name.

Bot.name2key(slname, function(result) { ... });

or using promises:

Bot.name2key(slname).then(function(result) { ... });

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 AVATAR = "Glaznah Gassner";

Bot.name2key(AVATAR)
	.then(function(result) {
		console.log("The uuid using promises is " + result.slkey);
		exit();
	});

Bot.name2key(AVATAR, function(result) {
	console.log("The uuid using callback is " + result.slkey);
	exit();
});