This repository was archived by the owner on Oct 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-15
lines changed
Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -12,28 +12,22 @@ export default async (client: Client) => {
1212
1313 allInfractions ?. forEach ( async ( infrac ) => {
1414 const type = infrac . userId ? 'user' : 'server' ;
15+ const targetId = infrac . userId ?? infrac . serverId ! ;
1516
16- const blacklistManager =
17- type === 'user'
18- ? new BlacklistManager ( 'user' , infrac . id )
19- : new BlacklistManager ( 'server' , infrac . id ) ;
20-
17+ const blacklistManager = new BlacklistManager ( type , targetId ) ;
2118 await blacklistManager . removeBlacklist ( infrac . hubId ) ;
2219
2320 if ( client . user ) {
21+ const opts = {
22+ id : targetId ,
23+ mod : client . user ,
24+ reason : 'Blacklist duration expired.' ,
25+ } ;
2426 if ( type === 'user' ) {
25- await logUserUnblacklist ( client , new HubManager ( infrac . hub ) , {
26- id : infrac . id ,
27- mod : client . user ,
28- reason : 'Blacklist duration expired.' ,
29- } ) ;
27+ await logUserUnblacklist ( client , new HubManager ( infrac . hub ) , opts ) ;
3028 }
3129 else if ( type === 'server' ) {
32- await logServerUnblacklist ( client , new HubManager ( infrac . hub ) , {
33- id : infrac . id ,
34- mod : client . user ,
35- reason : 'Blacklist duration expired.' ,
36- } ) ;
30+ await logServerUnblacklist ( client , new HubManager ( infrac . hub ) , opts ) ;
3731 }
3832 }
3933 } ) ;
You can’t perform that action at this time.
0 commit comments