Custom Command
FunctionsMessage Functions

$awaitMessage

The $awaitMessage function allows your bot to wait for a specific user's message or any message within a channel and then retrieve the message ID or content.

Usage

$awaitMessage[message;userid / everyone;timeout;return message ID instead of content]

Parameters:

  • message (Optional): The message the bot will send to prompt the user for input. If omitted, no message will be sent.
  • userid / everyone (Optional, Default: everyone): Specifies who the bot should listen for.
    • userid: A specific user's ID. The bot will only respond to messages from this user.
    • everyone: The bot will respond to any message in the channel.
  • timeout: The maximum time the bot will wait for a message (e.g., 10s). If no message is received within the timeout period, the function will return undefined.
  • return message ID instead of content: Determines what the function returns. Accepts yes or no.
    • yes: Returns the message ID of the user's reply.
    • no: Returns the content of the user's reply (default).

Return Value:

Returns the user's reply (content or ID, based on the return message ID parameter) or undefined if the timeout is reached.

Timeout

The timeout parameter specifies how long the bot will wait for a user's message. The format is [number][s|m|h] (e.g., 10s for 10 seconds, 1m for 1 minute).

Important: The maximum timeout duration is limited by the bot's tier: 60 x (bot tier + 1) seconds. For example, a tier 3 bot has a maximum timeout of 60 * (3 + 1) = 240 seconds.

Example:

This example sends the message "Are you tall?" and waits for the user who executed the command to respond. It then displays the user's answer.

!!exec Your answer is: $awaitMessage[Are you tall?;$authorID]
Member
9/5/2026

!!exec Your answer is: $awaitMessage[Are you tall?;$authorID]

Custom Command
APP
9/5/2026

Are you tall?

Member
9/5/2026

YES

Custom Command
APP
9/5/2026

Your answer is: YES

Function Cooldown

This function has built-in cooldown. Why? Read more about cooldowns here.

  • Cooldown: 2 seconds
  • Tracked By: User
  • Type: channeluser

Functions with the same type share cooldowns based on the same Tracked By value.

On this page