feat: match role embed color to role color for single role inputs#128
Open
SupaSeeka wants to merge 1 commit intoScottyLabs:mainfrom
Open
feat: match role embed color to role color for single role inputs#128SupaSeeka wants to merge 1 commit intoScottyLabs:mainfrom
SupaSeeka wants to merge 1 commit intoScottyLabs:mainfrom
Conversation
TenType
requested changes
Mar 23, 2026
Member
TenType
left a comment
There was a problem hiding this comment.
Thanks for contributing! I've requested a few changes; please see below.
Comment on lines
+78
to
+82
| const isSingleRole = | ||
| !roleString.match(/\b(AND|OR)\b/i) && !roleString.includes("("); | ||
| const singleRole = isSingleRole | ||
| ? interaction.guild.roles.cache.find((r) => r.name === roleString) | ||
| : null; |
Member
There was a problem hiding this comment.
Suggested change
| const isSingleRole = | |
| !roleString.match(/\b(AND|OR)\b/i) && !roleString.includes("("); | |
| const singleRole = isSingleRole | |
| ? interaction.guild.roles.cache.find((r) => r.name === roleString) | |
| : null; | |
| const singleRole = interaction.guild.roles.cache.find( | |
| (r) => r.name === roleString, | |
| ); |
If more than one role is passed, then it won't be found in the cache anyways, so we can remove the first line and the ternary operator.
| const singleRole = isSingleRole | ||
| ? interaction.guild.roles.cache.find((r) => r.name === roleString) | ||
| : null; | ||
| const roleColor = singleRole?.color || null; |
Member
There was a problem hiding this comment.
Suggested change
| const roleColor = singleRole?.color || null; | |
| const roleColor = singleRole?.colors.primaryColor; |
color is deprecated, use colors.primaryColor instead.
Comment on lines
139
to
144
| if (interaction.options.getSubcommand() === "count") { | ||
| const embed = new EmbedBuilder() | ||
| .setTitle(`"${roleString}"`) | ||
| .setDescription(`${members.length} members`); | ||
|
|
||
| return interaction.reply({ embeds: [embed] }); |
Member
There was a problem hiding this comment.
Can you also make this work for /role count?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #127
The role embed colour now matches the role colour. I have tested this in my own test server with evidence here:

/role members only takes the one string as an argument so no issue with multiple being added.