@@ -75,19 +75,19 @@ export async function executeResolution(
7575 // }
7676
7777 case resolutions . timeout :
78- await timeout ( reportedMember ) ;
78+ await timeout ( reportedMember , "voted resolution" ) ;
7979 break ;
8080
8181 case resolutions . restrict :
8282 await applyRestriction ( reportedMember ) ;
8383 break ;
8484
8585 case resolutions . kick :
86- await kick ( reportedMember ) ;
86+ await kick ( reportedMember , "voted resolution" ) ;
8787 break ;
8888
8989 case resolutions . ban :
90- await ban ( reportedMember ) ;
90+ await ban ( reportedMember , "voted resolution" ) ;
9191 break ;
9292 }
9393 } catch ( error ) {
@@ -147,11 +147,13 @@ async function executeScheduledResolution(
147147 const { modLog } = await fetchSettings ( escalation . guild_id , [
148148 SETTINGS . modLog ,
149149 ] ) ;
150- const [ guild , channel , reportedUser ] = await Promise . all ( [
150+ const [ guild , channel , reportedUser , votes ] = await Promise . all ( [
151151 client . guilds . fetch ( escalation . guild_id ) ,
152152 client . channels . fetch ( escalation . thread_id ) as Promise < ThreadChannel > ,
153153 client . users . fetch ( escalation . reported_user_id ) . catch ( ( ) => null ) ,
154+ getVotesForEscalation ( escalation . id ) ,
154155 ] ) ;
156+ const voters = new Set ( votes . map ( ( v ) => v . voter_id ) ) ;
155157 const [ reportedMember , vote ] = await Promise . all ( [
156158 guild . members . fetch ( escalation . reported_user_id ) . catch ( ( ) => null ) ,
157159 channel . messages . fetch ( escalation . vote_message_id ) ,
@@ -162,13 +164,16 @@ async function executeScheduledResolution(
162164 Number ( new Date ( escalation . created_at ) ) / 1000 ,
163165 ) ;
164166 const elapsedHours = Math . floor ( ( now - createdAt ) / 60 / 60 ) ;
167+ const totalVotes = votes . length ;
168+ const totalVoters = voters . size ;
169+
170+ const noticeText = `Resolved with ${ totalVotes } votes from ${ totalVoters } voters: **${ humanReadableResolutions [ resolution ] } ** <@${ escalation . reported_user_id } > (${ reportedUser ?. displayName ?? "no user" } )` ;
171+ const timing = `-# Resolved <t:${ now } :s>, ${ elapsedHours } hrs after escalation` ;
165172
166173 // Handle case where user left the server or deleted their account
167174 if ( ! reportedMember ) {
168175 const userLeft = reportedUser !== null ;
169- const reason = userLeft
170- ? "User left the server"
171- : "User account no longer exists" ;
176+ const reason = userLeft ? "left the server" : "account no longer exists" ;
172177
173178 log ( "info" , "EscalationResolver" , "Resolving escalation - user gone" , {
174179 ...logBag ,
@@ -180,10 +185,8 @@ async function executeScheduledResolution(
180185 await resolveEscalation ( escalation . id , resolutions . track ) ;
181186 await vote . edit ( { components : getDisabledButtons ( vote ) } ) ;
182187 try {
183- const displayName = reportedUser ?. username ?? "Unknown User" ;
184188 const notice = await vote . reply ( {
185- content : `Resolved: **${ humanReadableResolutions [ resolutions . track ] } ** <@${ escalation . reported_user_id } > (${ displayName } )
186- -# ${ reason } . Resolved <t:${ now } :s>, ${ elapsedHours } hrs after escalation` ,
189+ content : `${ noticeText } \n${ timing } (${ reason } )` ,
187190 } ) ;
188191 await notice . forward ( modLog ) ;
189192 } catch ( error ) {
@@ -203,8 +206,7 @@ async function executeScheduledResolution(
203206
204207 try {
205208 const notice = await vote . reply ( {
206- content : `Resolved: **${ humanReadableResolutions [ resolution ] } ** <@${ escalation . reported_user_id } > (${ reportedMember . displayName } )
207- -# Resolved <t:${ now } :s>, ${ elapsedHours } hrs after escalation` ,
209+ content : `${ noticeText } \n${ timing } ` ,
208210 } ) ;
209211 await notice . forward ( modLog ) ;
210212 } catch ( error ) {
0 commit comments