Skip to content

Commit

Permalink
Improve resilience to Discord changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jedenastka committed Aug 2, 2024
1 parent 3808f07 commit d9e6648
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/plugins/ircColors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,17 @@ export default definePlugin({
],
settings,
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) {
return calculateNameColorForUser(BigInt(context.user.id));
const id = context?.user?.id;
if (id == null) {
return null;
}
return calculateNameColorForUser(BigInt(id));
},
});

0 comments on commit d9e6648

Please sign in to comment.