DiscordEventCommand
Extends
Type parameters
• T extends keyof ClientEvents
= keyof ClientEvents
Properties
description?
optional
description:string
Inherited from
Source
locals
locals:
Dictionary
Custom data storage object for module-specific information. Plugins and module code can use this to store and retrieve metadata, configuration, or any other module-specific information.
Description
A key-value store that allows plugins and module code to persist data at the module level. This is especially useful for InitPlugins that need to attach metadata or configuration to modules.
Example
Example
Example
Example
Remarks
- The locals object is initialized as an empty object ({}) by default
- Keys should be namespaced to avoid collisions between plugins
- Values can be of any type
- Data persists for the lifetime of the module
- Commonly used by InitPlugins during module initialization
@best-practices
-
Namespace your keys to avoid conflicts:
-
Document the data structure you’re storing:
-
Use type-safe accessors when possible:
Inherited from
Source
meta
meta:
object
absPath
absPath:
string
id
id:
string
Inherited from
Source
name?
optional
name:T
Overrides
Source
onEvent
onEvent:
ControlPlugin
<any
[]>[]
Inherited from
Source
plugins
plugins:
InitPlugin
<any
[]>[]
Inherited from
Source
type
type:
Discord
Overrides
Source
Methods
execute()
execute(…
args
):unknown
Parameters
• …args: ClientEvents
[T
]
Returns
unknown