The UserMessage object is used to work with user-submitted messages, including text and attachments.
messageReturns the original text of the message.
Signature: message string
Arguments: none.
Example:
$msg = queue.last().message; // $msg contains the text of the user's last message.
attachmentsReturns a list of file IDs attached to the message.
Signature: attachments List<string>
Arguments: none.
Example:
$attachments = queue.first().attachments; // $attachments contains the list of attachments in the user's first message.
isEmpty()Determines whether the message is empty.
Signature: isEmpty() bool
Arguments: none.
Return value:
true — if the message is empty.false — if the message contains text or attachments.Example:
$isEmpty = queue.last().isEmpty(); // $isEmpty is true if the user's last message is empty, false otherwise.
hasAttachments()Checks whether the message contains any attachments.
Signature: hasAttachments() bool
Arguments: none.
Return value:
true — if attachments are present.false — if there are no attachments.Example:
$hasAttachments = queue.first().hasAttachments(); // $hasAttachments is true if the user's first message has attachments, false otherwise.