$awaitComponents
$awaitComponents
awaits components for given amount of uses.
Usage
$awaitComponents[channelID;messageID;userFilter;customIDs;commands;awaitedCmd;uses?;time]
Parameters
Field | Type | Description | Required |
---|---|---|---|
channelID | number | Channel ID of the message where it will be awaited. | true |
messageID | number | The ID of the message that will be awaited. | true |
userFilter | string | Users who can use the interaction. 1. everyone 2. specific user ID - any user ID. | true |
customID | number | Custom IDs that will be awaited, use , for multiple custom IDs. | true |
commands | string | The new interaction names to be used in interaction commands for the awaited customIDs, use , for multiple awaited commands. | true |
awaitedCmd | string | Awaited command to execute if time ran out. | true |
uses? | number | The times the awaited interactions can be used (default 1 ). | false |
time | string | The duration for which the interaction can be used. | true |
Example(s)
This will send a message with a button. It will wait for 30 seconds for the button to be clicked, examplebuttonresults
will be executed if the button has been clicked before the time runs out, otherwise errormessage
will be executed:
1client.command({2 name: "awaitComponents",3 code: `$awaitComponents[$channelID;$get[messageID];$authorID;examplebutton;examplebuttonresults;errormessage;1;30s]4 $let[messageID;$sendMessage[Please click on the button.{actionRow:{button:Random Button:2:examplebutton:false}};true]]`5});6
7client.interactionCommand({8 name: "examplebuttonresults",9 prototype: "button",10 code: `$interactionReply[You clicked the button!]`11});12
13client.awaitedCommand({14 name: "errormessage",15 code: `$editMessage[$get[messageID];Too late! Time has ran out!{actionRow:{button:Random Button:2:examplebutton:true}};$channelID]`16});