Skip to content

$hasComponents

$hasComponents checks if a message has components, returns boolean.

Usage

$hasComponents[channelID?;messageID?;type?]

Parameters

FieldTypeDescriptionRequired
channelID?numberThe channel ID of where the message is.false
messageID?numberThe ID of the message.false
type?stringComponent Types.false

Component Types

TypeDescription
any (default)Any component type
ActionRowContainer for other components
ButtonButton component
SelectMenuAny select menus
StringSelectSelect menu for picking from defined text options
ChannelSelectSelect menu for channels
RoleSelectSelect menu for roles
UserSelectSelect menu for users
MentionableSelectSelect menu for mentionables (users and roles)
TextInputText input component

Example(s)

This will return false since the message does not have a button:

1
client.command({
2
name: "hasComponents",
3
code: `$hasComponents[$channelID;$messageID;Button]`
4
});