The Commands Component in ShadowCore provides a structured way to define, manage, and execute commands within your Discord bot. This system ensures modularity, scalability, and ease of use.
ShadowCoreโs command system automatically loads and organizes commands from designated directories. Each command is defined in its own file, following a standardized structure.
A command in ShadowCore follows this basic structure:
Copy
import { Command } from "shadow-core";export default new Command({ name: "example", description: "This is an example command.", run: async (interaction) => { await interaction.reply("Hello from ShadowCore!"); },});
Copy
| Property | Type | Description ||---------------|---------|--------------------------------------------------|| `name` | string | The command's name (used for invocation). || `description` | string | A short description of the command. || `options` | array | (Optional) Command options for arguments. || `run` | function | The function executed when the command is used. |