Skip to content
Lists & Helpers mentionRole

$mentionRole — Builds the mention of a role from its ID, so you do not have to type <@&ID>

Builds the mention of a role from its ID, so you do not have to type `<@&ID>`.

Syntax

$mentionRole[roleID]

Parameters

  • roleID (ID, required) — A role ID. An empty value gives an empty result.

Return Value

  • string: <@&roleID>, or empty when the ID is empty.

Usage

$mentionRole[123456789] → "<@&123456789>"
$mentionRole[] → ""

Important Notes

  • An ID that is not a number raises the error “Invalid role ID.”.

Example

$sendMessage[$mentionRole[123456789]]

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.