new CommandHandler()
The constructor of the CommandHandler class.
- Source:
Methods
addCommand(command)
Adds a Command to the List of known Commands
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
command |
Command
|
The Command that should be added. |
addScript(script)
Adds a Script to the List of known Scripts. Triggers it if Discord Client already ready.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
script |
Script
|
The Script that should be added. |
commandListener(message)
Checks an Message for a Command and executes it if one has been found.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
message |
Message
|
The Discord Message that should be checked for a Command. |
loadCommands(target_path)
Loads all exported Commands inside of the given Path (goes also through the subfolders)
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
target_path |
The Path that should be crawled for exported Commands |
loadScripts(target_path)
Adds all exported Scripts inside of the given Path
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
target_path |
The Path that should be crawled for exported Scripts |
scriptTrigger()
Triggers all scripts that hasn't been triggered yet
- Source: