region_restart

From SmartBots Developers Docs
Jump to: navigation, search

Fires when bot receives a region restart notification. Not available for QubicBot yet (?)

Bot.on("region_restart", function(event) { ... });

Reference

This event comes with the following event object:

Variable Required Description
event object properties:
name The name of the event in this case region_restart
message The message of the region_restart
bot_uuid The UUID of the bot which receives the notification.
region_name The name of the region going to restart.
time_units Unit of Time in which region is going to restart:
  • Seconds
  • Minutes
time_left Amount of time till region restart based on time_units.
seconds_left Amount of time till region restart in seconds.

Comments

  • time_left contains time till restart in time_units
  • time_units are “Seconds”, “Minutes” - Unknown is sent when anything other is received.
  • seconds_left is time till restart in seconds

Example

console.log(`${process.name} started`);

Bot.on("region_restart", (event) => {
    console.log(`Region restart event:`, event);
});

Also see a complex region restart script in Examples.