Skip to content

Commit

Permalink
Add an option to enable colors in the member list
Browse files Browse the repository at this point in the history
  • Loading branch information
jedenastka committed Jun 25, 2024
1 parent 1d2da7c commit 9bf77cf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/plugins/fixCodeblockGap/README.md
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 19 additions & 2 deletions src/plugins/ircColors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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));
},
});

0 comments on commit 9bf77cf

Please sign in to comment.