Errors
A mistake says what is wrong and, when it knows, the line and the column: (line 2, column 10). There are three kinds.
Syntax mistakes
Section titled “Syntax mistakes”These are found when the code is checked, before it runs, so nothing is done.
| Message | What to do |
|---|---|
An action is never closed, a }} is missing |
An action started with {{ and never ended. Check quotes too: a " that is not closed hides the }} |
A ( is never closed |
A parenthesis is missing |
An "if" is never closed with "end" |
Add {{ end }}. The same for range and with |
"end" without a block to close |
There is one {{ end }} too many |
"else" outside an if, range or with |
else only goes inside those blocks |
A command is empty |
An action has nothing, or ends with a ` |
Only a function can take arguments |
Something like {{ 1 2 }}. The first word must be a function |
Unexpected character "x" |
A character the language does not know |
A number this big loses its last digits |
Write the ID between quotes: "123456789012345678" |
A comment must end with */}} |
Close a comment like {{/* ... */}} |
Mistakes while running
Section titled “Mistakes while running”| Message | What to do |
|---|---|
There is no function called "x" |
Check the name in Functions. Upper and lower case matter |
add takes at least 2 arguments, got 1 |
The function needs more arguments |
The variable $x is not defined |
Create it first with $x := ..., in a block that is still open |
Cannot read .X of nil |
Part of the path does not exist. Check with if or with first |
Expected a number, got text "x" |
A math function got a text that is not a number |
Cannot compare list with number |
lt, gt, le and ge need two numbers or two texts |
The index 3 is out of the list (it has 2) |
Check len before using index |
Cannot divide by zero |
Check the number before dividing |
Expected a role as a Discord ID in quotes |
An ID must be text with 15 to 22 digits |
cembed does not know "x" |
The message lists the names that exist |
"break" only works inside a range |
break and continue need a loop |
Limit mistakes
Section titled “Limit mistakes”The code did too many steps, The code took longer than 250 ms, The loops ran more than 1000 turns,
The code printed more than 20000 characters, A text got too long and Too many actions of this kind mean the code
went over a limit of Limits. Make the loop shorter or split the work in two commands.
Stored data, buttons and menus
Section titled “Stored data, buttons and menus”| Message | What to do |
|---|---|
Stored data is not available here |
Stored data works in custom commands, not in other places |
A key is a text of 1 to 100 letters, numbers, . _ : or - |
Change the key |
A stored value holds at most 4000 characters |
Store less in each value, or split it |
This server already stores 500 values, the most it can |
Remove values you do not need with dbDel |
That key does not hold a number |
dbIncr only works on numbers. Use another key, or dbDel the old one |
Too many reads and writes of stored data: at most 25 per run |
Read once and keep the result in a variable |
A button needs an id of 1 to 20 letters, numbers, - or _ |
Add "id" "name" to the button |
A button needs a label or an emoji |
Add "label" or "emoji" |
respond only works when the command runs because of a button or a menu |
Check .Trigger first, and only use respond and updateMessage for "button" and "select" |
A direct message cannot have buttons or menus |
Send it to a channel with sendMessage instead |
A message holds at most 5 rows of buttons or menus |
Use fewer rows |
That is not for you / This is not for you. |
The button was locked to another member with "user" |
That command does not exist anymore. |
The command of that button was removed |
