_assert

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

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

Input

Variable

Required

Description

assertion

yes

Any boolean expression.

errorMessage

yes

The message to send to the error log if assertion is false.

Output

This function does not return anything.

Comments

If the assertion evaluates to false, the provided errorMessage is logged to the error log.
Useful for debugging and validating assumptions during bot script execution.

Examples

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