@@ -68,9 +68,11 @@ const initHarmonix = async (
6868 events : new Collection ( ) ,
6969 commands : new Collection ( ) ,
7070 contextMenus : new Collection ( ) ,
71- buttons : new Collection ( ) ,
72- modals : new Collection ( ) ,
73- selectMenus : new Collection ( ) ,
71+ components : {
72+ buttons : new Collection ( ) ,
73+ modals : new Collection ( ) ,
74+ selectMenus : new Collection ( )
75+ } ,
7476 preconditions : new Collection ( )
7577 }
7678}
@@ -84,9 +86,9 @@ const watchReload = (
8486 harmonix . options . dirs . commands ,
8587 harmonix . options . dirs . events ,
8688 harmonix . options . dirs . contextMenus ,
87- harmonix . options . dirs . buttons ,
88- harmonix . options . dirs . modals ,
89- harmonix . options . dirs . selectMenus ,
89+ harmonix . options . dirs . components . buttons ,
90+ harmonix . options . dirs . components . modals ,
91+ harmonix . options . dirs . components . selectMenus ,
9092 harmonix . options . dirs . preconditions
9193 ] . map ( ( file ) => resolve ( harmonix . options . rootDir , file ) )
9294 const watcher = watch ( [ ...filesToWatch , harmonix . configFile ] , {
@@ -138,9 +140,9 @@ const clearHarmonix = async (harmonix: Harmonix) => {
138140 harmonix . events . clear ( )
139141 harmonix . commands . clear ( )
140142 harmonix . contextMenus . clear ( )
141- harmonix . buttons . clear ( )
142- harmonix . modals . clear ( )
143- harmonix . selectMenus . clear ( )
143+ harmonix . components . buttons . clear ( )
144+ harmonix . components . modals . clear ( )
145+ harmonix . components . selectMenus . clear ( )
144146 harmonix . preconditions . clear ( )
145147}
146148
@@ -181,14 +183,16 @@ const loadHarmonix = async (
181183 ...( harmonix . options . contextMenus || [ ] ) ,
182184 ...scannedContextMenus
183185 ] . map ( ( ctm ) => resolveContextMenu ( ctm , harmonix . options ) )
184- const buttons = [ ...( harmonix . options . buttons || [ ] ) , ...scannedButtons ] . map (
185- ( btn ) => resolveButton ( btn , harmonix . options )
186- )
187- const modals = [ ...( harmonix . options . modals || [ ] ) , ...scannedModals ] . map (
188- ( mdl ) => resolveModal ( mdl , harmonix . options )
189- )
186+ const buttons = [
187+ ...( harmonix . options . components ?. buttons || [ ] ) ,
188+ ...scannedButtons
189+ ] . map ( ( btn ) => resolveButton ( btn , harmonix . options ) )
190+ const modals = [
191+ ...( harmonix . options . components ?. modals || [ ] ) ,
192+ ...scannedModals
193+ ] . map ( ( mdl ) => resolveModal ( mdl , harmonix . options ) )
190194 const selectMenus = [
191- ...( harmonix . options . selectMenus || [ ] ) ,
195+ ...( harmonix . options . components ?. selectMenus || [ ] ) ,
192196 ...scannedSelectMenus
193197 ] . map ( ( slm ) => resolveSelectMenu ( slm , harmonix . options ) )
194198 const preconditions = [
0 commit comments