Skip to content
Math & Text isUserDmEnabled

$isUserDmEnabled

The function $isUserDmEnabled returns the value of the user.dmEnabled variable of the execution context. If the context does not provide it, the result is "true".

Syntax

$isUserDmEnabled
$isUserDmEnabled[(userID)]

Parameters

Parameter Description
userID Optional. Accepted but not used: the engine does not query Discord and returns the same context value whatever the ID.

Return Value

  • Type: String
  • The value of user.dmEnabled from the context, or "true" when it is absent.

Behavior

  • No Discord request is made: the engine does not check the user’s privacy settings.
  • The userID argument does not change the result.

Examples

Read the flag

$sendMessage[DM flag: $isUserDmEnabled]

Notes

  • A result of "true" does not guarantee that a DM can be delivered.

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.