Skip to content

Commit 02c2f41

Browse files
committed
reference: detail functions doc
- add <hr> between h2 sections for clearer separation - mention `.StackDepth` in execCC doc - fix indentation level of `footer` in cembed doc Signed-off-by: Luca Zeuch <[email protected]>
1 parent 7b1f3fe commit 02c2f41

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

content/docs/reference/templates/functions.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ values you can send in your response or use as arguments for other functions.
88

99
<!--more-->
1010

11+
----
12+
1113
## Channel
1214

1315
These functions relate to channels and threads.
@@ -213,6 +215,8 @@ Removes the given member from the given thread.
213215

214216
Unpins the given forum post, which may be specified by its ID or name.
215217

218+
----
219+
216220
## Database
217221

218222
These functions help you interact with the [custom command database](/learn/intermediate/database).
@@ -376,6 +380,8 @@ Numerical `dict` keys are retrieved as an `int64`, therefore you'd have to write
376380

377381
{{< /callout >}}
378382

383+
----
384+
379385
## Encoding and Decoding
380386

381387
### decodeBase64
@@ -447,6 +453,8 @@ byte `0xAB`.
447453
Returns the escaped value of the textual representation of the arguments in a form suitable for embedding in a URL
448454
query.
449455

456+
----
457+
450458
## Executing Custom Commands
451459

452460
These functions enable you to execute a custom command within an already running custom command.
@@ -472,6 +480,8 @@ Executes another custom command specified by `ccID`.
472480
- `delay`: the delay in seconds before executing the custom command.
473481
- `data`: some arbitrary data to pass to the executed custom command.
474482

483+
Calling `execCC` with 0 delay sets `.StackDepth` to the current recursion depth and limits it to 2.
484+
475485
#### Example
476486

477487
The following example showcases a custom command executing itself.
@@ -502,6 +512,8 @@ Schedules a custom command execution to occur in the future, identified by `key`
502512

503513
To cancel such a scheduled custom command before it runs, use [cancelScheduledUniqueCC](#cancelscheduleduniquecc).
504514

515+
----
516+
505517
## Interactions
506518

507519
{{< callout context="tip" title="Tip" icon="outline/rocket" >}}
@@ -745,6 +757,8 @@ This text is invisible to others!
745757
Returns the response or follow-up with the specified message ID belonging to the given interaction as a [message
746758
object](/docs/reference/templates/syntax-and-data#message). Is also valid for ephemeral messages.
747759

760+
----
761+
748762
## Math
749763

750764
### add
@@ -952,6 +966,8 @@ Returns the square root of X as a floating-point number.
952966

953967
Subtracts the provided numbers from each other. Detects the first number's type and returns the result accordingly.
954968

969+
----
970+
955971
## Member
956972

957973
### editNickname
@@ -1040,6 +1056,8 @@ Returns the count of online members on the current server, including bots.
10401056

10411057
Returns whether the specified member has the specified permission bit.
10421058

1059+
----
1060+
10431061
## Mentions
10441062

10451063
Certain mentions are escaped by default, such that they don't ping. These functions help you actually *pinging* these
@@ -1087,6 +1105,8 @@ Mentions the role with the given name without escaping it. Searches for first ca
10871105

10881106
Prefer [mentionRoleID](#mentionroleid), as IDs are guaranteed to be unique and do not change with role edits.
10891107

1108+
----
1109+
10901110
## Message
10911111

10921112
### addMessageReactions
@@ -1357,6 +1377,8 @@ Sends a message in the specified channel.
13571377

13581378
Unpins the specified message.
13591379

1380+
----
1381+
13601382
## Miscellaneous
13611383

13621384
### adjective
@@ -1396,7 +1418,7 @@ All keys are optional, but the Discord API will reject completey empty embeds, s
13961418
- `footer`: Shows some details at the very bottom of the embed. Is an sdict with the following keys:
13971419
- `text`: the footer's text
13981420
- `icon_url`: a small icon to display to the left of the footer's text
1399-
- `timestamp`: a (static) timestamp to display to the right of the footer's text
1421+
- `timestamp`: a (static) timestamp to display to the right of the footer's text
14001422

14011423
{{< callout context="tip" title="Tip" icon="outline/rocket" >}}
14021424

@@ -1672,6 +1694,8 @@ Limited to 1 call on regular servers and 3 calls on premium servers.
16721694

16731695
Returns a random verb.
16741696

1697+
----
1698+
16751699
## Role functions
16761700

16771701
### addRole
@@ -1897,6 +1921,8 @@ Reports whether the specified target has the specified role ID.
18971921
Reports whether the specified target has the specified role name (case-insensitive).
18981922
`target` may be a user ID, mention, or user object, but must be a member of the server.
18991923

1924+
----
1925+
19001926
## String manipulation
19011927

19021928
{{< callout context="note" title="Note" icon="outline/info-circle" >}}
@@ -2070,6 +2096,8 @@ Returns the string with all leading and trailing white space removed.
20702096

20712097
Converts `string` to all uppercase and returns the result.
20722098

2099+
----
2100+
20732101
## Time
20742102

20752103
### currentTime
@@ -2226,6 +2254,8 @@ function e.g.
22262254
{{< /callout >}}
22272255

22282256

2257+
----
2258+
22292259
## Type conversion
22302260

22312261
### structToSdict
@@ -2295,6 +2325,8 @@ Converts the given string to a slice of runes (Unicode code points).
22952325

22962326
Converts the input to a string, returning the empty string for invalid inputs.
22972327

2328+
----
2329+
22982330
## User
22992331

23002332
### currentUserAgeHuman

0 commit comments

Comments
 (0)