Skip to content
Database dbExists

$dbExists

$dbExists answers true or false. The data lives in the server’s space (the user’s own space in a direct message). $dbSpace switches the rest of the run to the user or the bot. A script can never read another server’s or another user’s data.

Syntax

$dbExists[collection;id]

Parameters

Parameter Description
collection Collection name: lowercase letters, digits, _, . or - (up to 64 characters). It is created on first write.
id Document id, 1 to 128 bytes. Often a Discord ID.

Return value

  • true or false.

Examples

$if[$dbExists[players;$authorID]==false]
  Use /start first.
$endif

Try it

Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.