Difference between revisions of "Bot Playground/Commands/isMyManager"
From SmartBots Developers Docs
(Created page with "{{DISPLAYTITLE:{{SUBPAGENAME}}}} <onlyinclude>Returns if the avatar is a Trusted Manager for the bot.</onlyinclude> <syntaxhighlight lang="javascript"> const res = await Bot....") |
|||
| (3 intermediate revisions by the same user not shown) | |||
| Line 22: | Line 22: | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
| − | let isManager = Bot.isMyManager( | + | Bot.on("chat_message", async function (event) { |
| − | console.log(` | + | let isManager = await Bot.isMyManager(event.speaker_name); |
| + | if(isManager) { | ||
| + | console.log(`Message from Trusted Manager`); | ||
| + | } | ||
| + | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{NavMenu}} | {{NavMenu}} | ||
__NOTOC__ | __NOTOC__ | ||
Latest revision as of 12:35, 17 February 2025
Returns if the avatar is a Trusted Manager for the bot.
const res = await Bot.isMyManager("slnameOrUUID");
console.log("Is Bot Manager:", res);
Reference
This command accepts the following parameters:
| Variable | Required | Description
| |
|---|---|---|---|
| Input: | |||
| slName or UUID | yes | The Avatar SL Name or UUID | |
| Output: | |||
| return value | boolean | true if resident is the trusted manager of the bot | |
Examples
Bot.on("chat_message", async function (event) {
let isManager = await Bot.isMyManager(event.speaker_name);
if(isManager) {
console.log(`Message from Trusted Manager`);
}
}