Difference between revisions of "Bot Playground/Built-in Functions/ assert"

From SmartBots Developers Docs
Jump to: navigation, search
(Add the _assert function)
 
m (Update title)
 
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
+
{{DISPLAYTITLE:_assert}}
 
<onlyinclude>Logs data to the error log if the assertion is false.</onlyinclude>
 
<onlyinclude>Logs data to the error log if the assertion is false.</onlyinclude>
  

Latest revision as of 12:59, 18 September 2025

Logs data to the error log if the assertion is false.

var online = await Bot.isOnline();
_assert(online, "Bot is not online");

Reference

This command accepts the following parameters:

Variable Required Description


Input:
assertion yes Any boolean expression.
errorMessage yes The message to send to the error log if assertion is false.
Output:
result This function does not return anything