aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2023-04-23 23:33:55 +0200
committerVendicated <vendicated@riseup.net>2023-04-23 23:33:55 +0200
commitdfc3f05834db65fc73fa939957a39498c0428a9c (patch)
tree14dcb9e12e1d5a6f534def47246390c0ae6520d9 /src
parent63fc354d483b86857bbee7f540c66ba614fc0f1f (diff)
downloadVencord-dfc3f05834db65fc73fa939957a39498c0428a9c.tar.gz
Vencord-dfc3f05834db65fc73fa939957a39498c0428a9c.tar.bz2
Vencord-dfc3f05834db65fc73fa939957a39498c0428a9c.zip
Fix RoleColorEverywhere crash
Diffstat (limited to 'src')
-rw-r--r--src/plugins/roleColorEverywhere.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/roleColorEverywhere.tsx b/src/plugins/roleColorEverywhere.tsx
index 65a1cc0..88a6cc2 100644
--- a/src/plugins/roleColorEverywhere.tsx
+++ b/src/plugins/roleColorEverywhere.tsx
@@ -53,7 +53,7 @@ export default definePlugin({
replacement: [
{
match: /user:(\i),channel:(\i).{0,300}?"@"\.concat\(.+?\)/,
- replace: "$&,color:$self.getUserColor($1.id,{channelId:$2?.id})"
+ replace: "$&,color:$self.getUserColor($1?.id,{channelId:$2?.id})"
}
],
predicate: () => settings.store.chatMentions,
@@ -99,10 +99,12 @@ export default definePlugin({
if (!(guildId ??= ChannelStore.getChannel(channelId!)?.guild_id)) return null;
return GuildMemberStore.getMember(guildId, userId)?.colorString ?? null;
},
+
getUserColor(userId: string, ids: { channelId?: string; guildId?: string; }) {
const colorString = this.getColor(userId, ids);
return colorString && parseInt(colorString.slice(1), 16);
},
+
roleGroupColor({ id, count, title, guildId }: { id: string; count: number; title: string; guildId: string; }) {
const guild = GuildStore.getGuild(guildId);
const role = guild?.roles[id];
@@ -113,6 +115,7 @@ export default definePlugin({
letterSpacing: ".05em"
}}>{title} &mdash; {count}</span>;
},
+
getVoiceProps({ user: { id: userId }, guildId }: { user: { id: string; }; guildId: string; }) {
return {
style: {