File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
packages/commandkit/src/handlers/command-handler Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import registerCommands from './functions/registerCommands';
9
9
import builtInValidations from './validations' ;
10
10
import colors from '../../utils/colors' ;
11
11
import rdfc from 'rfdc' ;
12
- import { SlashCommandBuilder } from 'discord.js' ;
13
12
14
13
const clone = rdfc ( ) ;
15
14
@@ -81,17 +80,6 @@ export class CommandHandler {
81
80
let importedObj = await import ( `${ modulePath } ?t=${ Date . now ( ) } ` ) ;
82
81
let commandObj : CommandFileObject = clone ( importedObj ) ; // Make commandObj extensible
83
82
84
- // Ensure builder properties
85
- if ( importedObj . default ) {
86
- commandObj . data = importedObj . default . data ;
87
- } else {
88
- commandObj . data = importedObj . data ;
89
- }
90
-
91
- try {
92
- commandObj . data = ( commandObj . data as any ) . toJSON ( ) ;
93
- } catch ( error ) { }
94
-
95
83
// If it's CommonJS, invalidate the import cache
96
84
if ( typeof module !== 'undefined' && typeof require !== 'undefined' ) {
97
85
delete require . cache [ require . resolve ( commandFilePath ) ] ;
@@ -101,6 +89,13 @@ export class CommandHandler {
101
89
102
90
if ( commandObj . default ) commandObj = commandObj . default as CommandFileObject ;
103
91
92
+ // Ensure builder properties
93
+ if ( importedObj . default ) {
94
+ commandObj . data = importedObj . default . data ;
95
+ } else {
96
+ commandObj . data = importedObj . data ;
97
+ }
98
+
104
99
if ( ! commandObj . data ) {
105
100
console . log (
106
101
colors . yellow (
You can’t perform that action at this time.
0 commit comments