@@ -97,13 +97,25 @@ export async function actualBanCmd(
9797 }
9898
9999 // Create a new case for the updated ban since we never stored the old case id and log the action
100+ const expiryTimestamp = time && time > 0 ? Math . ceil ( ( Date . now ( ) + time ) / 1000 ) : null ;
101+ const expiryRelative = expiryTimestamp ? `<t:${ expiryTimestamp } :R>` : null ;
102+ const noteDetails : string [ ] = [ ] ;
103+ if ( time && time > 0 ) {
104+ noteDetails . push ( `Ban updated to ${ humanizeDuration ( time ) } ` ) ;
105+ if ( expiryRelative ) {
106+ noteDetails . push ( `Expires ${ expiryRelative } ` ) ;
107+ }
108+ } else {
109+ noteDetails . push ( "Ban updated to indefinite" ) ;
110+ }
111+
100112 const casesPlugin = pluginData . getPlugin ( CasesPlugin ) ;
101113 const createdCase = await casesPlugin . createCase ( {
102114 modId : mod . id ,
103115 type : CaseTypes . Ban ,
104116 userId : user . id ,
105117 reason : formattedReason ,
106- noteDetails : [ `Ban updated to ${ time ? humanizeDuration ( time ) : "indefinite" } ` ] ,
118+ noteDetails,
107119 } ) ;
108120 if ( time ) {
109121 pluginData . getPlugin ( LogsPlugin ) . logMemberTimedBan ( {
@@ -124,7 +136,7 @@ export async function actualBanCmd(
124136
125137 pluginData . state . common . sendSuccessMessage (
126138 context ,
127- `Ban updated to ${ time ? " expire in " + humanizeDuration ( time ) + " from now" : "indefinite" } ` ,
139+ `Ban updated to ${ time && expiryRelative ? ` expire ${ expiryRelative } ` : "indefinite" } ` ,
128140 ) ;
129141 lock . unlock ( ) ;
130142 return ;
@@ -171,6 +183,9 @@ export async function actualBanCmd(
171183 return ;
172184 }
173185
186+ const banExpiryTimestamp = time && time > 0 ? Math . ceil ( ( Date . now ( ) + time ) / 1000 ) : null ;
187+ const banExpiryRelative = banExpiryTimestamp ? `<t:${ banExpiryTimestamp } :R>` : null ;
188+
174189 let forTime = "" ;
175190 if ( time && time > 0 ) {
176191 forTime = `for ${ humanizeDuration ( time ) } ` ;
@@ -185,6 +200,10 @@ export async function actualBanCmd(
185200 response = `Member forcebanned ${ forTime } (Case #${ banResult . case . case_number } )` ;
186201 }
187202
203+ if ( banExpiryRelative ) {
204+ response += ` ⏰ ${ banExpiryRelative } ` ;
205+ }
206+
188207 lock . unlock ( ) ;
189208 pluginData . state . common . sendSuccessMessage ( context , response ) ;
190209}
0 commit comments