File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { COMMAND_EXECUTION_TYPES } from '../../Utility/Constants/AxonEnums';
17
17
* @prop {GuildConfig } guildConfig - The GuildConfig data-structure with all DB saved settings
18
18
* @prop {String } prefix - The prefix used for this command
19
19
* @prop {String } command - The full label of the command being executed
20
+ * @prop {String } usedCommandLabel - The used label of the command being executed
20
21
* @prop {COMMAND_EXECUTION_TYPES } executionType - Execution type: admin, owner, regular
21
22
*/
22
23
class CommandEnvironment {
@@ -40,6 +41,7 @@ class CommandEnvironment {
40
41
this . prefix = data . prefix || null ;
41
42
42
43
this . command = data . command !== undefined ? data . command . fullLabel : null ;
44
+ this . usedLabel = null ;
43
45
44
46
this . guildConfig = data . guildConfig || null ;
45
47
@@ -96,11 +98,13 @@ class CommandEnvironment {
96
98
* Set the command label from the command object
97
99
*
98
100
* @param {Command } command
101
+ * @param {String } usedLabel
99
102
* @returns {CommandEnvironment } This CommandEnvironment
100
103
* @memberof CommandEnvironment
101
104
*/
102
- setCommand ( command ) {
105
+ setCommand ( command , usedLabel ) {
103
106
this . command = command . fullLabel ;
107
+ this . usedLabel = usedLabel ;
104
108
return this ;
105
109
}
106
110
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ class CommandDispatcher {
131
131
if ( ! command ) { // command doesn't exist or not globally enabled
132
132
return ;
133
133
}
134
- env . setCommand ( command ) ;
134
+ env . setCommand ( command , label ) ;
135
135
env . resolveArgs ( null , args . join ( ' ' ) ) ;
136
136
137
137
/* Send help for the resolved command */
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export declare class CommandEnvironment<T extends LibTextableChannel = LibTextab
13
13
/** The raw message content */
14
14
public raw : string ;
15
15
public command : string ;
16
+ public usedLabel : string ;
16
17
public msg : LibMessage < T > ;
17
18
public args : string [ ] ;
18
19
public prefix : string ;
@@ -53,11 +54,11 @@ export declare class CommandEnvironment<T extends LibTextableChannel = LibTextab
53
54
public setGuildConfig ( guildConfig : GuildConfig ) : this;
54
55
55
56
/**
56
- * Set the command lavel from the command object
57
+ * Set the command label from the command object
57
58
* @returns This CommandEnvironment
58
59
* @memberof CommandEnvironment
59
60
*/
60
- public setCommand ( command : Command ) : CommandEnvironment ;
61
+ public setCommand ( command : Command , usedLabel : string ) : CommandEnvironment ;
61
62
62
63
/**
63
64
* Resolve the argument from the args string.
You can’t perform that action at this time.
0 commit comments