checkScriptedAgent
Returns if the resident is a scripted agent known by SmartBots. This includes all SmartBots bots and other residents our system considers bots or scripted agents.
const res = await Bot.checkScriptedAgent("slnameOrUUID");
console.log("Is Bot Scripted Agent:", res);Input
Variable | Required | Description |
|---|---|---|
| yes | The Avatar SL Name or UUID |
Output
Variable | Type | Description |
|---|---|---|
| boolean |
|
Examples
Bot.on("chat_message", async function (event) {
let isBot = await Bot.checkScriptedAgent(event.speaker_name);
if (isBot) {
console.log(`Message from Bot`);
}
});