Skip to content
Modules moduleFeature

$moduleFeature

$moduleFeature tells whether a feature of a module is on, and gives its name or the features it needs.

Syntax

$moduleFeature[id;feature;field;separator]

Parameters

Parameter Description
id Required. The identifier of the module.
feature Required. The key of the feature (see $moduleInfo[id;features]).
field Optional. enabled (default), name or requires.
separator Optional. Text between the items of requires. Default ,.

Return value

  • Type: String
  • true or false for enabled.

JavaScript

bc.module.feature(id, feature, field) returns a boolean for enabled and an array for requires.

Behavior

  • An unknown module or feature raises an error.
  • Features are those of the whole bot: they are turned on and off in the app and the Studio, not from a server.

Examples

$if[$moduleInfo[tickets;installed]==true]
Transcripts: $moduleFeature[tickets;transcripts]
$endif

Notes

  • Everything is read from the modules installed on the bot, so a module added later is covered with no change to your script.
  • See the guide Module and command functions.

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.