Documentation
Functions
Parse

parse

Parse is the main function of this package. It parses the parser and returns the parsed messagePayload data.

Code

parse(
	`{newEmbed:
        {title:hi}
        {description:hello}
        {color:Random}
        {timestamp}
        {footer:hi}
    }
    {actionRow:
        {button:Hi:1:hi}
    }`
);

Output

{
    data: {
        content: "",
        embeds: [{
            title: "hi",
            description: "hello",
            color: 16777215,
            timestamp: "2021-10-05T12:00:00.000Z",
            footer: {
                text: "hi"
            }
        }],
        components: [{
            type: 1,
            components: [{
                type: 2,
                label: "Hi",
                style: 1,
                custom_id: "hi"
            }]
        }]
    }
}