@@ -41,12 +41,11 @@ export default class MoveNode extends Command {
4141 }
4242
4343 public async run ( client : Lavamusic , ctx : Context , args : string [ ] ) : Promise < any > {
44- // If no node specified, show available nodes as before
4544 let nodeId : string | undefined ;
4645 if ( args . length > 0 ) {
4746 nodeId = args . join ( " " ) ;
4847 } else if ( ctx . options && typeof ctx . options . get === "function" ) {
49- const nodeOption = ctx . options . get ( "node" , /* required */ false ) ;
48+ const nodeOption = ctx . options . get ( "node" , false ) ;
5049 nodeId = nodeOption ?. value as string | undefined ;
5150 } else {
5251 nodeId = undefined ;
@@ -101,7 +100,6 @@ export default class MoveNode extends Command {
101100 } ) ;
102101 }
103102
104- // Validate the target node exists and is connected
105103 const targetNode = client . manager . nodeManager . nodes . get ( nodeId ) ;
106104 if ( ! targetNode ) {
107105 return await ctx . sendMessage ( {
@@ -129,7 +127,6 @@ export default class MoveNode extends Command {
129127 } ) ;
130128 }
131129
132- // If all players are already on the target node
133130 const allOnTarget = Array . from ( allPlayers . values ( ) ) . every (
134131 ( player ) => player . node . options . id === nodeId ,
135132 ) ;
@@ -158,7 +155,6 @@ export default class MoveNode extends Command {
158155 } ) ;
159156 }
160157
161- // Move all players to the new node
162158 const results : {
163159 guildId : string ;
164160 from : string ;
@@ -185,7 +181,6 @@ export default class MoveNode extends Command {
185181 }
186182 }
187183
188- // Prepare summary
189184 const successMoves = results . filter ( ( r ) => ! r . error ) ;
190185 const failedMoves = results . filter ( ( r ) => r . error ) ;
191186
@@ -221,7 +216,6 @@ export default class MoveNode extends Command {
221216 description = ctx . locale ( I18N . commands . movenode . messages . no_players_moved ) ;
222217 }
223218
224- // Send a summary message
225219 const resultTitle = ctx . locale ( I18N . commands . movenode . messages . results_title ) ;
226220 const resultColor = failedMoves . length > 0 ? this . client . color . red : this . client . color . green ;
227221 const resultTimestamp = new Date ( ) . toISOString ( ) ;
@@ -252,7 +246,7 @@ export default class MoveNode extends Command {
252246 return ;
253247 } catch ( error ) {
254248 logger . error ( "Failed to move player nodes:" , error ) ;
255- // Error handling
249+
256250 if ( ctx . interaction && ( ctx . interaction . replied || ctx . interaction . deferred ) ) {
257251 await ctx . editMessage ( {
258252 embeds : [
0 commit comments