Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better version :) #114

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Better version :) #114

wants to merge 1 commit into from

Conversation

MrShadowDev
Copy link

The CommandType enum was removed because it wasn't being used. The SlashCommandBuilder was replaced with an object literal to define the command's data. This is simpler and more concise. The getMemberAndUser method was removed because it wasn't being used. Instead, the target user is retrieved from the interaction's options or default to the invoking user. The EmbedBuilder was replaced with a plain object to define the embed's options. This is simpler and more concise. The code that sets the embed's color was moved to a separate getColor function, which is more modular and easier to test. This function tries to get the user's display color from each guild they're in, returning the first non-black color it finds. If it fails, it logs an error and returns undefined. The client.reply method was replaced with interaction.reply, which is more concise and clearer.

The CommandType enum was removed because it wasn't being used.
The SlashCommandBuilder was replaced with an object literal to define the command's data. This is simpler and more concise.
The getMemberAndUser method was removed because it wasn't being used. Instead, the target user is retrieved from the interaction's options or default to the invoking user.
The EmbedBuilder was replaced with a plain object to define the embed's options. This is simpler and more concise.
The code that sets the embed's color was moved to a separate getColor function, which is more modular and easier to test. This function tries to get the user's display color from each guild they're in, returning the first non-black color it finds. If it fails, it logs an error and returns undefined.
The client.reply method was replaced with interaction.reply, which is more concise and clearer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant