Skip to main content

Buttons

Buttons in ShadowCore allow you to create interactive buttons that users can click to trigger specific actions. Buttons are a part of the broader interactive components system and are used for a variety of purposes, such as opening menus, executing commands, and more.

πŸ“‚ Button Structure

Buttons in ShadowCore are organized within the /buttons directory and categorized into subfolders. Example Folder Structure:

βš™οΈ Properties

The Button component allows you to specify the following properties:

🧩 Usage

To create a button, you must define the button’s customId. Here’s an example of creating a simple button:

Handling Dynamic Buttons

You can also create dynamic buttons using special IDs, like so:
In this example, the splitSpecialId method splits the customId into components, allowing you to use dynamic values (e.g., ticket IDs).