1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 09:56:24 +00:00

Improve resilience to Discord changes

This commit is contained in:
Grzesiek11 2024-08-02 13:03:22 +02:00
parent 3808f07ed8
commit d9e6648b33
No known key found for this signature in database
GPG key ID: 4A5445FB68CDB5C4

View file

@ -83,9 +83,17 @@ export default definePlugin({
], ],
settings, settings,
calculateNameColorForMessageContext(context: any) { calculateNameColorForMessageContext(context: any) {
return calculateNameColorForUser(BigInt(context.message.author.id)); const id = context?.message?.author?.id;
if (id == null) {
return null;
}
return calculateNameColorForUser(BigInt(id));
}, },
calculateNameColorForListContext(context: any) { calculateNameColorForListContext(context: any) {
return calculateNameColorForUser(BigInt(context.user.id)); const id = context?.user?.id;
if (id == null) {
return null;
}
return calculateNameColorForUser(BigInt(id));
}, },
}); });