Difference between revisions of "Bot Playground/Commands/setGroupRole"
From SmartBots Developers Docs
(Created page with "{{DISPLAYTITLE:{{SUBPAGENAME}}}} <onlyinclude>Puts member of a group in a specific role.</onlyinclude> <syntaxhighlight lang="javascript"> Bot.setGroupRole(location); </synta...") |
|||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
| − | <onlyinclude>Puts member of a group in a specific role.</onlyinclude> | + | <onlyinclude>Puts member of a group in a specific role.</onlyinclude> Also see a [[Bot Playground/Commands/revokeGroupRole|revokeGroupRole]] function. |
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
| − | Bot.setGroupRole( | + | Bot.setGroupRole(avatar_uuid, group_uuid, role_uuid) |
| + | .then(function(result) { | ||
| + | if(result.success) { console.log("Role revoked"); } | ||
| + | }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 10: | Line 13: | ||
{{API Variable Group|Input}} | {{API Variable Group|Input}} | ||
| − | {{API Variable| | + | {{API Variable|avatar_uuid|yes}} The UUID of the avatar which should be moved to the specific role |
| − | {{API Variable| | + | {{API Variable|group_uuid|yes}} The UUID of the group |
| − | + | {{API Variable|role_uuid|yes}} The UUID of the group role. "Everyone" role is 00000000-0000-0000-0000-000000000000 | |
{{API Variable Group|Output}} | {{API Variable Group|Output}} | ||
| Line 18: | Line 21: | ||
{{API Variables Table End}} | {{API Variables Table End}} | ||
| + | |||
| + | == Comments == | ||
| + | |||
| + | Make sure your bot has sufficient rights to assign/revoke members from group roles. | ||
| + | |||
| + | Check the [[Bot_Playground/Setting_and_revoking_group_roles|complex example]] for function usage. | ||
{{NavMenu}} | {{NavMenu}} | ||
__NOTOC__ | __NOTOC__ | ||
Latest revision as of 21:12, 31 October 2016
Puts member of a group in a specific role. Also see a revokeGroupRole function.
Bot.setGroupRole(avatar_uuid, group_uuid, role_uuid)
.then(function(result) {
if(result.success) { console.log("Role revoked"); }
});
Reference
This command accepts the following parameters:
| Variable | Required | Description
| |
|---|---|---|---|
| Input: | |||
| avatar_uuid | yes | The UUID of the avatar which should be moved to the specific role | |
| group_uuid | yes | The UUID of the group | |
| role_uuid | yes | The UUID of the group role. "Everyone" role is 00000000-0000-0000-0000-000000000000 | |
| Output: | |||
| Function returns a Promise with the following data: | |||
| success | bool | true if command completed successfully | |
| error | string | error string if command has failed | |
Comments
Make sure your bot has sufficient rights to assign/revoke members from group roles.
Check the complex example for function usage.