status

From SmartBots Developers Docs
Bot PlaygroundCommands
Revision as of 13:56, 18 October 2022 by Gg (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Returns the online status of the bot.

const res = await Bot.status();
console.log("Status:", JSON.stringify(res, null, 2));

Reference

This command accepts the following parameters:

Variable Required Description


Input:
Output:
Function returns a Promise with the following data:
success bool true if command completed successfully
error string error string if command has failed
status Current online status of the bot (see "Details")
online "1" if bot is online, "0" otherwise
slname Full SL name of the bot
uuid Bot avatar UUID
location Current bot location if bot is online ("Region/X/Y/Z")

Details

The following statuses can be returned:

  • ONLINE - the bot is online
  • PRE-CONNECTING - the bot is going to log in and waits for a SL login server response
  • CONNECTING - SL login server logs the bot in
  • LOGGED OUT - bot is logged out now (gracefully, by the owner's command)
  • OFFLINE - bot can not be contacted. This is an unexpected behavior and usually happens while SmartBots servers are restarting

Examples

Bot.status().then(function(res) {
	console.log("Status:", res);
});