Skip to content
Variables onlyIfSet

$onlyIfSet — Stops the script with a message while a setting is empty

Stops the script with a message while a setting is empty. A setting (log channel, role…) is empty until the administrator fills it.

Syntax

$onlyIfSet[variable;message;(scope);(target);(guildID)]

Parameters

  • variable (text, required) — The setting.
  • message (text, required) — Sent when the setting is empty, then the script stops.
  • scope (text, optional) — Same as $increment. Default: server.
  • target (ID, optional) — Same as $increment.
  • guildID (ID, optional) — Same as $increment.

Return Value

  • empty.

Usage

$onlyIfSet[logChannel;An admin must set the log channel first.]

Example

$sendMessage[$onlyIfSet[logChannel;An admin must set the log channel first.]]

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.