Difference between revisions of "Bot Playground/Commands/isMyManager"

From SmartBots Developers Docs
Jump to: navigation, search
Line 23: Line 23:
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
Bot.on("chat_message", async function (event) {
 
Bot.on("chat_message", async function (event) {
let isBot = await Bot.checkScriptedAgent(event.speaker_name);
+
let isManager = await Bot.isMyManager(event.speaker_name);
if(isBot) {
+
if(isManage) {
console.log(`Message from Bot`);
+
console.log(`Message from Trusted Manager`);
 
}
 
}
 
}
 
}

Revision as of 12:34, 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(isManage) {
		console.log(`Message from Trusted Manager`);
	}
}