MessageLogger: fix attachment ignore (#1989)

This commit is contained in:
AutumnVN 2023-11-16 01:13:19 +07:00 committed by GitHub
parent c080a0eaac
commit 6578eb487e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -302,6 +302,7 @@ export default definePlugin({
match: /attachments:(\i)\((\i)\)/,
replace:
"attachments: $1((() => {" +
" if ($self.shouldIgnore($2)) return $2;" +
" let old = arguments[1]?.attachments;" +
" if (!old) return $2;" +
" let new_ = $2.attachments?.map(a => a.id) ?? [];" +