Difference between revisions of "Bot Playground/Commands/isMyOwner"
From SmartBots Developers Docs
Line 22: | Line 22: | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
− | let isOwner = await Bot.isMyOwner( | + | Bot.on("chat_message", async function (event) { |
− | console.log(` | + | let isOwner = await Bot.isMyOwner(event.speaker_name); |
+ | if(isOwner) { | ||
+ | console.log(`Message from Owner`); | ||
+ | } | ||
+ | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{NavMenu}} | {{NavMenu}} | ||
__NOTOC__ | __NOTOC__ |
Latest revision as of 12:33, 17 February 2025
Returns if the bot is owned by the avatar.
const res = await Bot.isMyOwner("slnameOrUUID");
console.log("Is Bot Owner:", 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 owner of the bot |
Examples
Bot.on("chat_message", async function (event) {
let isOwner = await Bot.isMyOwner(event.speaker_name);
if(isOwner) {
console.log(`Message from Owner`);
}
}