1-
21const {
32 EmbedBuilder,
43 ButtonBuilder,
@@ -25,7 +24,7 @@ class SpamBanningService {
2524
2625 if ( message . channelId !== config . channels . automodBlockChannelId ) {
2726 const response =
28- await SpamBanningService . #AskForDeleteMessages ( interaction ) ;
27+ await SpamBanningService . #askForDeleteMessages ( interaction ) ;
2928
3029 if ( response . result === 'cancel' ) {
3130 await interaction . editReply ( {
@@ -81,7 +80,7 @@ class SpamBanningService {
8180 }
8281 }
8382
84- static async #AskForDeleteMessages ( interaction ) {
83+ static async #askForDeleteMessages ( interaction ) {
8584 const keepMessages = new ButtonBuilder ( )
8685 . setCustomId ( 'keepMessages' )
8786 . setLabel ( "Don't delete messages" )
@@ -111,18 +110,19 @@ class SpamBanningService {
111110 } ) ;
112111
113112 try {
114- const buttonInteraction = await response . resource . message . awaitMessageComponent ( { time : 60_000 } ) ;
115-
113+ const buttonInteraction =
114+ await response . resource . message . awaitMessageComponent ( { time : 60_000 } ) ;
115+
116116 // Handle the button interaction
117117 if ( buttonInteraction . customId === 'cancel' ) {
118- await buttonInteraction . update ( {
119- content : 'Action has been cancelled.' ,
120- components : [ ] ,
121- } ) ;
122- } else {
123- // Acknowledge the button press but don't change the message yet
124- await buttonInteraction . deferUpdate ( ) ;
125- }
118+ await buttonInteraction . update ( {
119+ content : 'Action has been cancelled.' ,
120+ components : [ ] ,
121+ } ) ;
122+ } else {
123+ // Acknowledge the button press but don't change the message yet
124+ await buttonInteraction . deferUpdate ( ) ;
125+ }
126126 return { result : buttonInteraction . customId } ;
127127 } catch {
128128 return { result : 'timeout' } ;
@@ -143,10 +143,12 @@ class SpamBanningService {
143143 } else {
144144 reply = `Banned <@${ message . author . id } > for spam but wasn't able to contact the user as they have left the server.` ;
145145 }
146+
146147 await guild . members . ban ( message . author . id , {
147148 reason : 'Account is compromised' ,
148149 deleteMessageSeconds : deleteMessages ? 60 * 60 * 24 * 7 : 0 ,
149150 } ) ;
151+
150152 return reply ;
151153 }
152154
0 commit comments