1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 09:56:24 +00:00

Add an option to enable colors in the member list

This commit is contained in:
Grzesiek11 2024-06-25 19:27:13 +02:00
parent 1d2da7c15b
commit 9bf77cf1db
No known key found for this signature in database
GPG key ID: 4A5445FB68CDB5C4
2 changed files with 28 additions and 2 deletions

View file

@ -0,0 +1,9 @@
# FixCodeblockGap
Removes the gap between codeblocks and text below it
![Message with a codeblock on vanilla Discord]()
![Message with a codeblock with FixCodeblockGap]()
Fixes an annoying Discord bug causing codeblocks to always have a gap between
them and the following text.

View file

@ -53,6 +53,12 @@ const settings = definePluginSettings({
type: OptionType.NUMBER,
default: 70,
},
memberListColors: {
description: "Replace role colors in the member list",
restartNeeded: true,
type: OptionType.BOOLEAN,
default: false,
},
});
export default definePlugin({
@ -64,12 +70,23 @@ export default definePlugin({
find: "=\"SYSTEM_TAG\"",
replacement: {
match: /(?<=className:\i\.username,style:.{0,50}:void 0,)/,
replace: "style:{color:$self.calculateNameColorForContext(arguments[0])},"
replace: "style:{color:$self.calculateNameColorForMessageContext(arguments[0])},",
},
},
{
find: ".NameWithRole,{roleName:",
replacement: {
match: /(?<=color:)null!=.{0,50}?(?=,)/,
replace: "$self.calculateNameColorForListContext(arguments[0])",
},
predicate: () => settings.store.memberListColors,
},
],
settings,
calculateNameColorForContext(context: any) {
calculateNameColorForMessageContext(context: any) {
return calculateNameColorForUser(BigInt(context.message.author.id));
},
calculateNameColorForListContext(context: any) {
return calculateNameColorForUser(BigInt(context.user.id));
},
});