A package for programming anything you want with ease.
A package for programming anything you want with ease.
WARNING: not full compatibility with other things besides Discord bot creation. Expect more compatibility in v5.
bash
npm i hytescript.js
`
Note that HyteScript.js needs Node.js v16.9.0 or later to work properly.
Index example
`js
const hytescript = require("hytescript.js");
new hytescript.DiscordClient({
token: "your bot token here",
prefix: "your bot prefix here",
intents: ["your intents here"]
}) // DiscordClient have support for chaining!
.addCommands({
name: 'ping',
code:
})
.addEvents("messageCreate");
`
Understanding how HyteScript works
HyteScript has a basic syntax:
Text #(function parameter1 | parameter2...) more text
Note that using whitespaces between parameter separator and parameter doesn't matter, HyteScript will remove it for you.
Just like HyteScript removes whitespaces, it also removes \n (new-line, line break...). For using it, you must use %br% (it's case insensitive, so you can use %BR%, %Br%...).
HyteScript reads your code from top to bottom, left to right, just like you're reading this.
Functions names are also case insensitive, so you can use #(fuNCTion) or #(FUNCTION), it will work normally.
Text
The text is everything that doesn't have a special meaning.
Anything outside a function or inside a function as a parameter is considered text.
#(
Start of a function. When the # is used without (, then it will be interpreted as text. The same happens when ( is used without #.
Functions always needs that to be used.
Function
The name of the function that you're going to use. Other functions can't be used inside it, unless you use eval.
Parameters
Parameters are the text that will be sent to the function. Parameters are separated by |, so if you're going to provide the value for the second parameter, you need to use it.
Functions accepts other functions or subfunctions inside it, e.g. #(function parameter | #(function parameter))`.