listGroups

From SmartBots Developers Docs
Bot PlaygroundCommands
Revision as of 18:56, 13 July 2016 by Gg (Talk | contribs) (Created page with "{{DISPLAYTITLE:{{SUBPAGENAME}}}} <onlyinclude>Returns a list of the Second Life groups the bot is member of.</onlyinclude> <syntaxhighlight lang="javascript"> Bot.listGroups(...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Returns a list of the Second Life groups the bot is member of.

Bot.listGroups().then(function(result) { ... });

Reference

This command accepts the following parameters:

Variable Required Description


Input:
-- none --
Output:
Function returns a Promise with the following data:
success bool true if command completed successfully
error string error string if command has failed
groups The object which contains all groups. Format:
{
  "uuid-1": "group-name-1",
  "uuid-2": "group-name-2",
  ...
}

See "Examples" section below for details.


Examples

List all groups

Print all bot groups:

Bot.listGroups()
.then(function(result) {
	var list = "";
	
	for(var k in result.groups) {
		list = list + k + ": " + result.groups[k] + "\n";
	}
	
	console.log(list);
	
	exit();
});

Random Group Tag Activator

See this example here.