Wait a button to be pressed and return its button Id, or undefined in case of no button pressed until the timeout.


This function supports the Message Curl Format. This way, you can send a message with buttons by using {button:label:style/url:emoji:id:newline(yes/no)}.

Usage: $awaitButton[Message (optional);user id (optional, default:author);timeout (optional, default:15s);button id1 (optional);button id2...]


It means the maximum time bot can wait user button click for.
it accept format of time like 10s.
The max time is 60 x bot tier seconds, for example for tier 3 it would be 180 seconds.


(Simple response)

(Usage example)

$let[pressedButton;$awaitButton[Which color is my favorite?
/* Saves the pressed button id in a temporary var, so you can retrieve later */

/* If the button id is different from red, which is the right answer, then incorrect. Else, correct. */

Choosing something other them red, or nothing.

Choosing red.


You can send an embed using the Message Curl Format.

Function difficulty: Medium
Tags: await button interaction click