@@ -346,35 +346,35 @@ export default definePlugin({
346
346
replacement : [
347
347
{
348
348
// Add deleted=true to all target messages in the MESSAGE_DELETE event
349
- match : / M E S S A G E _ D E L E T E : f u n c t i o n \ (( \i ) \) { let.+ ?( (?: \i \. ) { 2 } ) g e t O r C r e a t e .+ ?} , / ,
349
+ match : / f u n c t i o n (? = . + ? M E S S A G E _ D E L E T E : ( \i ) ) \1 \ (( \i ) \) { let.+ ?( (?: \i \. ) { 2 } ) g e t O r C r e a t e .+ ?} (? = f u n c t i o n ) / ,
350
350
replace :
351
- "MESSAGE_DELETE: function($1 ){" +
352
- " var cache = $2getOrCreate($1 .channelId);" +
353
- " cache = $self.handleDelete(cache, $1 , false);" +
354
- " $2commit (cache);" +
355
- "}, "
351
+ "function $1($2 ){" +
352
+ " var cache = $3getOrCreate($2 .channelId);" +
353
+ " cache = $self.handleDelete(cache, $2 , false);" +
354
+ " $3commit (cache);" +
355
+ "}"
356
356
} ,
357
357
{
358
358
// Add deleted=true to all target messages in the MESSAGE_DELETE_BULK event
359
- match : / M E S S A G E _ D E L E T E _ B U L K : f u n c t i o n \ (( \i ) \) { let.+ ?( (?: \i \. ) { 2 } ) g e t O r C r e a t e .+ ?} , / ,
359
+ match : / f u n c t i o n (? = . + ? M E S S A G E _ D E L E T E _ B U L K : ( \i ) ) \1 \ (( \i ) \) { let.+ ?( (?: \i \. ) { 2 } ) g e t O r C r e a t e .+ ?} (? = f u n c t i o n ) / ,
360
360
replace :
361
- "MESSAGE_DELETE_BULK: function($1 ){" +
362
- " var cache = $2getOrCreate($1 .channelId);" +
363
- " cache = $self.handleDelete(cache, $1 , true);" +
364
- " $2commit (cache);" +
365
- "}, "
361
+ "function $1($2 ){" +
362
+ " var cache = $3getOrCreate($2 .channelId);" +
363
+ " cache = $self.handleDelete(cache, $2 , true);" +
364
+ " $3commit (cache);" +
365
+ "}"
366
366
} ,
367
367
{
368
368
// Add current cached content + new edit time to cached message's editHistory
369
- match : / ( M E S S A G E _ U P D A T E : f u n c t i o n \ (( \i ) \) .+ ?) \. u p d a t e \( ( \i ) / ,
369
+ match : / ( f u n c t i o n ( \i ) \ (( \i ) \) .+ ?) \. u p d a t e \( ( \i ) (? = . * M E S S A G E _ U P D A T E : \2 ) / ,
370
370
replace : "$1" +
371
- ".update($3 ,m =>" +
372
- " (($2 .message.flags & 64) === 64 || $self.shouldIgnore($2 .message, true)) ? m :" +
373
- " $2 .message.edited_timestamp && $2 .message.content !== m.content ?" +
374
- " m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($2 .message, m)]) :" +
371
+ ".update($4 ,m =>" +
372
+ " (($3 .message.flags & 64) === 64 || $self.shouldIgnore($3 .message, true)) ? m :" +
373
+ " $3 .message.edited_timestamp && $3 .message.content !== m.content ?" +
374
+ " m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($3 .message, m)]) :" +
375
375
" m" +
376
376
")" +
377
- ".update($3 "
377
+ ".update($4 "
378
378
} ,
379
379
{
380
380
// fix up key (edit last message) attempting to edit a deleted message
@@ -488,12 +488,12 @@ export default definePlugin({
488
488
find : '"ReferencedMessageStore"' ,
489
489
replacement : [
490
490
{
491
- match : / M E S S A G E _ D E L E T E : f u n c t i o n \( ( \i ) \) . + ? } , / ,
492
- replace : "MESSAGE_DELETE:function($1) {},"
491
+ match : / M E S S A G E _ D E L E T E : \i , / ,
492
+ replace : "MESSAGE_DELETE:()=> {},"
493
493
} ,
494
494
{
495
- match : / M E S S A G E _ D E L E T E _ B U L K : f u n c t i o n \( ( \i ) \) . + ? } , / ,
496
- replace : "MESSAGE_DELETE_BULK:function($1) {},"
495
+ match : / M E S S A G E _ D E L E T E _ B U L K : \i , / ,
496
+ replace : "MESSAGE_DELETE_BULK:()=> {},"
497
497
}
498
498
]
499
499
} ,
0 commit comments