add color to "replying to {user}" (#228)
Some checks are pending
Test / Test (push) Waiting to run

This commit is contained in:
mochie 2025-04-11 23:46:52 +02:00 committed by GitHub
parent cf7dc5522d
commit f858a745a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -125,6 +125,13 @@ export default definePlugin({
],
predicate: () => settings.store.dmList,
},
{
find: '"Reply Chain Nudge")',
replacement: {
match: /(,color:)(\i),/,
replace: "$1$self.colorInReplyingTo(arguments[0]) ?? $2,",
},
},
],
colorDMList(a: any): string | undefined {
@ -142,5 +149,10 @@ export default definePlugin({
const color = getCustomColorString(a.message.author.id, true);
return color ?? roleColor ?? undefined;
}
},
colorInReplyingTo(a: any) {
const { id } = a.reply.message.author;
return getCustomColorString(id, true);
},
});