Function Variables
Below you'll find a list of BotWiz's helpful functions which allow you to get values and complete processes much quicker.
Some functions will require certain things to be inputted, this could be a date, the unit it outputs the value in, and more.
Note: Functions cannot have spaces in them when typed unless it's between two speech marks ("like this").
{func_hasRoles()}
{func_hasRoles([array])}
Check if a user has the roles in the array (list the IDs).
Parameter: [USER_ID]
{func_randomItem()}
{func_randomItem([1, 2, 3])}
Get a random item from the array. Parameter: [Number]
{func_atPosition([]), []}
{func_atPosition([a, b, c]), [1]}
Get the element at the specified index. (1 in the example).
{func_suze([])}
{func_suze([1, 2, 3])}
Get the size of the array [1, 2, 3].
{func_replace()}
{func_replace(hello world, world universe)}
Replaces world with universe in the string.
Parameter: [First_OCC or ALL_OCC, test]
{func_toUpperCase()}
{func_toUpperCase(hello)}
Converts the string to uppercase.
(Result: HELLO)
{func_toLowerCase()}
{func_toLowerCase(HELLO)}
Converts the string to lowercase.
(Result: hello)
{func_toTitleCase()}
{func_toTitleCase(hello world)}
Converts the string to title case.
(Result: Hello World)
{func_trim()}
{func_trim( hello )}
Removes the spaces before and after a string. (Result: hello)
{func_substring()}
{func_substring(hello world, 0, 5)}
Extracts the selected string from the larger string. (hello from world)
{func_length()}
{func_length(hello)}
Returns the string's length.
(Result: 5)
{func_split()}
{func_split(a-b-c, -)}
Splits the string at the specified character into an array.
(Result: [a,b,c])
{func_concat()}
{func_concat(hello, world)}
Concatenates (joins) hello and world.
{func_contains()}
{func_contains(hello world, world)}
Checks if the string contains another string. (if it contains world)
{func_startsWith()}
{func_startsWith(hello world, hello)}
Checks if a string starts with another string.
{func_endsWith()}
{func_endsWith(hello world, world)}
Checks if a string ends with another string.
{func_indexOf()}
{func_indexOf(hello world, world)}
Returns the index of a string in another string or -1 if not found. (index of world)
{func_lastIndexOf()}
{func_lastIndexOf(hello world hello,hello)}
Returns the last index of a string in another string. (If it appears more than once, otherwise it's the same as the one above)
{func_charAt()}
{func_charAt(hello,1)}
Returns the character that is in the specified index (index being 1 in this example)
{func_scramble()}
{func_scramble(hello)}
Scrambles the string given.
{func_reverse()}
{func_revers(hello)}
Reverses the string given. (Result: elloh)
{func_repeat()}
{func_repeat(hello, 3)}
Repeats the string the amount of times given. (In this case: 3)
{func_generateRandomString()}
{func_generateRandom
String(3)}
Generates a random string with the specified length (In this case: 3)
{func_equation()}
{func_equation(5 + 3 / 2)}
Solves the given equation and returns the answer.
{func_randomNumber()}
{func_randomNumber(1, 5)}
Returns a random number in the given range.
{func_roundNumber()}
{func_round
Number(3.14159, 2)}
Rounds the number to the given number of decimal places. (Result: 3.14)
{func_isNumber()}
{func_isNumber(123)}
Checks if a number is valid.
{func_ISOtoUnix()}
{func_ISOtoUnix(Your Date)}
Converts the ISO date to Unix.
{func_UnixToISO()}
{func_UnixToISO(Your Date)}
Converts the Unix date to ISO.
{func_isSameDate()}
{func_isSameDate(date, date)}
Checks if 2 dates are the same.
{func_currentTime()}
X
Returns the current time in HH:mm:ss format.
{func_currentDateTime()}
X
Returns the current time in YYYY-MM-DD HH:mm:ss format.
{func_currentTimestamp()}
X
Returns the current timestamp in seconds.
{func_currentTimestampMillis()}
X
Returns the current timestamp in milliseconds.
{func_formatDate(date, formatting)}
{func_formatDate(2024-01-01, MM/DD/YYYY)
Formats the date into the desired format.
{func_addTime()}
{func_addTime(date, number, unit)}
Adds the desired amount of time to a date.
{func_subtractTime()}
{func_subtractTime(date, number, unit)}
Removes the desired amount of time from a date.
{func_differenceTime()}
{func_differenceTime(date1, date2, unit)}
Calculates the difference between 2 dates in the specified unit.
{func_isBeforeDate()}
{func_isBeforeDate(date1, date2)}
Checks if date1 is before date2.
{func_isAfterDate()}
{func_isAfterDate(date1, date2)}
Checks if date1 is after date2.
{func_isSameDate()}
{func_isSameDate(date1, date2)}
Checks if date1 and date2 are the same date.
Last updated
Was this helpful?