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:
parent
3808f07ed8
commit
d9e6648b33
1 changed files with 10 additions and 2 deletions
|
@ -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));
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue