function

fun function(name: String, c: CommandBuilder.() -> Unit): Func(source)

Creates a new function with the given name

Returns the created function which can be called using Func.call

Example:

val func = namespace.function("test") {
cmd("say Hello Func!")
}

namespace.onLoad {
cmd(func.call()) // generates 'function namespace:test'
}

See also


Creates a new function with a random UUID as the name

Returns the created function which can be called using Func.call

Example:

val func = namespace.function {
cmd("say Hello Func!")
}

namespace.onLoad {
cmd(func.call()) // generates 'function namespace:<uuid>'
}

See also