$loop
$loop
will execute awaited commands a given amount of times.
Usage
$loop[time;awaitData;...awaitedCmds]
Parameters
Field | Type | Description | Required |
---|---|---|---|
time | string | How often to execute the loop. | true |
awaitData | object | Awaited Data. | true |
…awaitedCmds | string | Awaited Commands to execute. | true |
Example(s)
This will execute a loop that will edit the sent message 5 times with the given content in awaitData
:
1client.command({2 name: "loop",3 code: `4 $loop[5;{ "message": "$get[messageID]", "channel": "$channelID" };editMessage]5 $let[messageID;$sendMessage[My ping is: $pingMS;true]]6 `7});
We use $awaitData
to retrieve the given properties in the awaitData
field in the loop command.
1client.awaitedCommand({2 name: "editMessage",3 code: `4 $editMessage[$awaitData[message];$pingMS;$awaitData[channel]]5 $wait[5s]6 `7});