aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutumnVN <autumnvnchino@gmail.com>2023-10-13 09:26:18 +0700
committerGitHub <noreply@github.com>2023-10-13 04:26:18 +0200
commit188d12d1a3de40f536011f679de1ec52be4dc32e (patch)
tree6947f5ddaa3156693f87c747e1583c64fa2d5f06
parenta522eab40dff096ce6ff80dd9660dd0530e4d480 (diff)
downloadVencord-188d12d1a3de40f536011f679de1ec52be4dc32e.tar.gz
Vencord-188d12d1a3de40f536011f679de1ec52be4dc32e.tar.bz2
Vencord-188d12d1a3de40f536011f679de1ec52be4dc32e.zip
roleColorEverywhere: role group color in thread/forum (#1778)
-rw-r--r--src/plugins/roleColorEverywhere/index.tsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/roleColorEverywhere/index.tsx b/src/plugins/roleColorEverywhere/index.tsx
index 8b256f4..e4fa4fe 100644
--- a/src/plugins/roleColorEverywhere/index.tsx
+++ b/src/plugins/roleColorEverywhere/index.tsx
@@ -44,7 +44,7 @@ const settings = definePluginSettings({
export default definePlugin({
name: "RoleColorEverywhere",
- authors: [Devs.KingFish, Devs.lewisakura],
+ authors: [Devs.KingFish, Devs.lewisakura, Devs.AutumnVN],
description: "Adds the top role color anywhere possible",
patches: [
// Chat Mentions
@@ -78,6 +78,10 @@ export default definePlugin({
match: /(memo\(\(function\((\i)\).{300,500}CHANNEL_MEMBERS_A11Y_LABEL.{100,200}roleIcon.{5,20}null,).," \u2014 ",.\]/,
replace: "$1$self.roleGroupColor($2)]"
},
+ {
+ match: /children:\[.," \u2014 ",.\]/,
+ replace: "children:[$self.roleGroupColor(arguments[0])]"
+ },
],
predicate: () => settings.store.memberList,
},
@@ -105,7 +109,7 @@ export default definePlugin({
return colorString && parseInt(colorString.slice(1), 16);
},
- roleGroupColor({ id, count, title, guildId }: { id: string; count: number; title: string; guildId: string; }) {
+ roleGroupColor({ id, count, title, guildId, label }: { id: string; count: number; title: string; guildId: string; label: string; }) {
const guild = GuildStore.getGuild(guildId);
const role = guild?.roles[id];
@@ -113,7 +117,7 @@ export default definePlugin({
color: role?.colorString,
fontWeight: "unset",
letterSpacing: ".05em"
- }}>{title} &mdash; {count}</span>;
+ }}>{title ?? label} &mdash; {count}</span>;
},
getVoiceProps({ user: { id: userId }, guildId }: { user: { id: string; }; guildId: string; }) {