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

Sort /help #182

Merged
merged 7 commits into from
Apr 14, 2023
Merged

Sort /help #182

merged 7 commits into from
Apr 14, 2023

Conversation

vyneer
Copy link
Contributor

@vyneer vyneer commented Mar 8, 2023

Closes #179.

Sorts /help alphabetically, also separates admin commands from regular ones. Admin commands only show up if you have mod powers.

Regular user Admin
ksnip_20230308-183916 image

feat: separate admin commands from regular ones
@vyneer vyneer added the enhancement New feature or request label Mar 8, 2023
@vyneer vyneer requested a review from 11k March 8, 2023 15:54
Copy link
Contributor

@11k 11k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This chaining of static methods here bothers me a lot. Let's take a step back and refactor this.

  • Move the commandsinfo object into a separate module.
  • Simplify the object's structure by removing the unnecessary arrays.
  • Manually alphabetize the object.
  • Create and export a class in this module for command-related operations.
  • Add whatever methods to this class you think are necessary to do what you need.
  • Write unit tests for the method that generates a help string.

assets/chat/js/commands.js Outdated Show resolved Hide resolved
assets/chat/js/commands.js Outdated Show resolved Hide resolved
assets/chat/js/commands.js Outdated Show resolved Hide resolved
assets/chat/js/commands.js Outdated Show resolved Hide resolved
assets/chat/js/commands.test.js Outdated Show resolved Hide resolved
@vyneer vyneer requested a review from 11k April 6, 2023 04:35
@11k 11k merged commit 70b1a47 into destinygg:master Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sort /help commands alphabetically
2 participants