Registering Custom Commands
Registering Custom CommandsCommand Module Structure
Command Module Structureconst MyCustomCommand = {
// Command name (without the ! prefix)
name: 'commandname',
// Command description (shown in !help)
description: 'Description of what the command does',
// Command usage example
usage: '!commandname [arguments]',
// Command handler function
handler: async ({ username, args, bot, commandManager }) => {
// Command logic goes here
return `Response message to send to chat`;
}
};Creating Your First Custom Command
Creating Your First Custom CommandIntegrating Custom Commands into Your Project
Integrating Custom Commands into Your ProjectMethod 1: Using the enabledCommands Option
Method 1: Using the enabledCommands OptionMethod 2: Using the Command Manager After Bot Creation
Method 2: Using the Command Manager After Bot CreationAdvanced Command Features
Advanced Command FeaturesAccessing Bot Services
Accessing Bot ServicesUsing the Skillful AI Client
Using the Skillful AI ClientMaintaining Command State
Maintaining Command StateCommand with Initialization Logic
Command with Initialization LogicBest Practices for Custom Commands
Best Practices for Custom CommandsTesting Your Custom Commands
Testing Your Custom CommandsNext Steps
Next StepsLast updated