@@ -14,8 +14,6 @@ export default new Command('edit', async (caller, cmd, log) => {
1414 if ( ! message || message . type !== 'STAFF_REPLY' )
1515 return caller . utils . discord . createMessage ( cmd . channel . id , 'The message could not be found.' ) ;
1616
17- caller . db . editMessage ( log ! , message . id , cmd . args . slice ( 1 ) . join ( ' ' ) ) ;
18-
1917 const userMsg = await caller . utils . discord . fetchMessage ( log ! . recipient . id , message . complementaryID ! , true ) ;
2018 if ( ! userMsg || ! userMsg . embeds [ 0 ] )
2119 return caller . utils . discord . createMessage ( cmd . channel . id , 'The message could not be found.' ) ;
@@ -24,14 +22,16 @@ export default new Command('edit', async (caller, cmd, log) => {
2422 userMsg . embeds [ 0 ] . description = cmd . args . slice ( 1 ) . join ( ' ' ) ;
2523 userMsg . edit ( { embed : userMsg . embeds [ 0 ] } )
2624 . catch ( ( ) => {
27- return caller . utils . discord . createMessage ( cmd . channel . id , 'The message could not be edited.' ) ;
25+ return caller . utils . discord . createMessage ( cmd . channel . id , 'The message could not be edited for the user .' ) ;
2826 } ) ;
2927
28+ caller . db . editMessage ( log ! , message . id , cmd . args . slice ( 1 ) . join ( ' ' ) ) ;
29+
3030 guildMsg . embeds [ 0 ] . description = cmd . args . slice ( 1 ) . join ( ' ' ) ;
3131 guildMsg . embeds [ 0 ] . footer ? guildMsg . embeds [ 0 ] . footer . text = 'Edited' : guildMsg . embeds [ 0 ] . footer = { text : 'Edited' } ;
3232 guildMsg . edit ( { embed : guildMsg . embeds [ 0 ] } )
3333 . catch ( ( ) => {
34- return caller . utils . discord . createMessage ( cmd . channel . id , 'The message could not be edited.' ) ;
34+ return caller . utils . discord . createMessage ( cmd . channel . id , 'The message could not be edited in this channel .' ) ;
3535 } ) ;
3636 caller . utils . discord . createMessage ( cmd . channel . id , 'The message has been edited.' ) ;
3737} ,
0 commit comments