mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-11 15:43:02 -04:00
Fix CustomUserColors (#152)
* fix the code equicord devs (not discord) broke * Spacing --------- Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com>
This commit is contained in:
parent
53eb329cbc
commit
2f3bda934e
1 changed files with 3 additions and 4 deletions
|
@ -85,8 +85,8 @@ export default definePlugin({
|
||||||
// this also affects name headers in chats outside of servers
|
// this also affects name headers in chats outside of servers
|
||||||
find: ".USERNAME),{",
|
find: ".USERNAME),{",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(\i=\{.{0,50})\?\{color:\i\}:void 0/,
|
match: /style:"username"===.{0,25}void 0/,
|
||||||
replace: "color=$self.colorIfServer(arguments[0]),$1?{color:color}:{color:color}"
|
replace: "style:{color:$self.colorIfServer(arguments[0])}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -108,8 +108,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
|
|
||||||
colorIfServer(a: any): string | undefined {
|
colorIfServer(a: any): string | undefined {
|
||||||
const roleColor = a.author?.colorString;
|
const roleColor = a.author?.colorString ?? "inherit";
|
||||||
if (!roleColor) return;
|
|
||||||
|
|
||||||
if (a.channel.guild_id && !settings.store.colorInServers) return roleColor;
|
if (a.channel.guild_id && !settings.store.colorInServers) return roleColor;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue