$function

Create a user-defined function that can be called by $callFunction or $functionName

Usage:

$function[Function name;Param 1 (optional);Param 2...(optional)]

Example:

$function[printHello;name]
    Hello $name
$endFunction
1
2
3

Call the function, using $callFunction

Member09/25/2022
!!exec $function[printHello;name]
Hello $name 👋
$endFunction $callFunction[printhello;Mika]
Custom Command Bot 09/25/2022
Hello Mika 👋

Call the function, using $printHello

Member09/25/2022
!!exec $function[printHello;name]
Hello $name 👋
$endFunction $printhello[Mika]
Custom Command Bot 09/25/2022
Hello Mika 👋

Global function

defining global function will allow you to execute this function from another custom command

How?

add /global to the name when defining the function

Member09/25/2022
!!exec $function[printHello/global;name]{
Hello $name 👋
}
Member09/25/2022
!!exec $callFunction[printHello;Mika]
Custom Command Bot 09/25/2022
Hello Mika 👋

DANGER

A function name can't start with number, and must be within [A-Z or a-z or _ or 0-9] for short format ($functionName) but if you are using $callFunction to call the function, any name is valid

Calling global function for first time

You will need to use $callFunction if you called a global function inside another custom command for first time, afterward you can use the short format i.e $printHello

Function difficulty Difficult
Tags: Function Custom Functions Nested code