Skip to content

Commit 3dbf5fa

Browse files
committed
docs: migrate mention functions
Signed-off-by: Luca Zeuch <[email protected]>
1 parent f912a3c commit 3dbf5fa

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

content/docs/reference/templates/functions.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -921,27 +921,42 @@ Returns whether the specified member has the specified permission bit.
921921

922922
## Mentions
923923

924-
| **Function** | **Description** |
925-
| ---------------------------- | ------------------------------------------------------------------------ |
926-
| `mentionEveryone` | Mentions `@everyone`. |
927-
| `mentionHere` | Mentions `@here`. |
928-
| `mentionRoleID` roleID | Mentions the role found with the provided ID. |
929-
| `mentionRoleName` "rolename" | Mentions the first role found with the provided name (case-insensitive). |
924+
Certain mentions are escaped by default, such that they don't ping. These functions help you actually *pinging* these
925+
special mentions.
930926

931-
There is also .Mention method available for channel, role, user structs/objects.
927+
### mentionEveryone
932928

933-
### Mentions section's snippets
929+
```yag
930+
{{ mentionEveryone }}
931+
```
932+
933+
Mentions `@everyone` without escaping it.
934+
935+
### mentionHere
936+
937+
```yag
938+
{{ mentionHere }}
939+
```
940+
941+
Mentions `@here` without escaping it.
934942

935-
- `<@{{.User.ID}}>` Outputs a mention to the user that called the command and is the same as `{{.User.Mention}}`
936-
- `<@###########>` Mentions the user that has the ID ###### (See [How to get IDs](/docs/reference/how-to-get-ids) to get ID).
937-
- `<#&&&&&&&&&&&>` Mentions the channel that has ID &&&&&& (See [How to get IDs](/docs/reference/how-to-get-ids) to get ID).
943+
### mentionRoleID
944+
945+
```yag
946+
{{ mentionRoleID <roleID> }}
947+
```
948+
949+
Mentions the given role without escaping it.
950+
951+
### mentionRoleName
952+
953+
```yag
954+
{{ mentionRoleName <roleName> }}
955+
```
938956

939-
* `<@&##########>` Mentions the role with ID ######## ([listroles](/docs/core/all-commands#listroles) command
940-
gives roleIDs). This is usable for example with `{{sendMessageNoEscape nil "Welcome to role <@&11111111...>"}}`.
941-
Mentioning that role has to be enabled server- side in Discord.
957+
Mentions the role with the given name without escaping it. Searches for first case-insensitive match.
942958

943-
- `</cmdName:cmdID>` Mentions a slash command, and makes it clickable and interactive with proper arguments e.g.
944-
`</howlongtobeat:842397645104087061>`.
959+
Prefer [mentionRoleID](#mentionroleid), as IDs are guaranteed to be unique and do not change with role edits.
945960

946961
## Message
947962

0 commit comments

Comments
 (0)