📜Lists

JavaScript arrays.

What are lists?

Lists are just like regular lists; They can contain elements. Here's a list, in human-readable form.

===========================

  • Bot

  • Maker

  • For

  • Discord

===========================

At position #0 of the list lays "Bot"

At position #3 of the list lays "Discord"

*Use "Get List Element" to get the elements of a list*

Got the hang of it yet? Great!

Sorting Lists

This one's pretty complicated - it takes some understanding, but I'll try my best provide some insight.\

That is the sort list action. You might wonder what "sort value of iteration" means, which is fair.

Every iteration, you need to output a value. That value will have to be the sort value. For example, I can place a "Get Member Data" action inside "for each iteration, run" and make it's output the sort value

Since this is hard to explain, here's some rawdata:

Rawdata
    {
  "name": "sort_by_xp",
  "type": "action",
  "trigger": "textCommand",
  "actions": [
    {
      "name": "Get Guild Members List",
      "file": "getGuildMembersList.js",
      "data": {
        "name": "Get Guild Members List",
        "get": "Variables",
        "store": {
          "type": "temporary",
          "value": "Members"
        }
      },
      "id": 1705769663591
    },
    {
      "name": "Sort List",
      "file": "sortList.js",
      "data": {
        "name": "Sort List",
        "list": {
          "type": "tempVar",
          "value": "Members"
        },
        "sortType": "Increasing Numerically",
        "storeIterationAs": {
          "type": "temporary",
          "value": ""
        },
        "storeValueAs": {
          "type": "temporary",
          "value": "Member"
        },
        "actions": [
          {
            "name": "Get Member Data",
            "file": "getMemberData.js",
            "data": {
              "name": "Get Member Data",
              "user": {
                "type": "tempVar",
                "value": "Member"
              },
              "dataName": "XP",
              "defaultValue": "0",
              "store": {
                "type": "temporary",
                "value": "Sort Value (XP)"
              }
            },
            "id": 1705769658891
          }
        ],
        "sortValue": {
          "type": "tempVar",
          "value": "Sort Value (XP)"
        },
        "store": {
          "type": "temporary",
          "value": ""
        }
      },
      "id": 1705769522609
    }
  ],
  "customId": 1705769521588,
  "boundary": {
    "worksIn": "guild",
    "limits": []
  },
  "parameters": [],
  "description": "No Description"
} 

Last updated