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

Modifying example to search command subfolders #1486

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JonathanRJoyner
Copy link

This portion of the guide is confusing because it does not work with a previous section title "Command Categories" which has the user move commands in to subcommand folders.

The changes I've made allow for the full commands folder to be searched for a matching command. This will work no matter the path to the file inside the command folder.

This portion of the guide is confusing because it does not work with the previous section title "Command Categories" which has the user move commands in to subcommand folders.

The changes I've made allow for the full commands folder to be searched for a matching command. This will work no matter the path to the file inside the command folder.
@GodderE2D
Copy link
Contributor

This would require users to download the glob package using npm. As this is not stated on the page, I would recommend adding a part for installing the package.

@JonathanRJoyner
Copy link
Author

Good point. Added a line about installing glob.

@@ -14,8 +14,13 @@ This section assumes you followed the [Command Handling](/creating-your-bot/comm
The reload command ideally should not be used by every user. You should deploy it as a guild command in a private guild.
:::

We will use the glob package to navigate our slash command file structure. This can be installed via npm by running `npm i glob` in the terminal.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
We will use the glob package to navigate our slash command file structure. This can be installed via npm by running `npm i glob` in the terminal.
You can use the glob package to navigate your slash command file structure. To install the package run `npm install glob` in the terminal.

wording and consistency https://github.com/discordjs/guide/blob/main/CONTRIBUTING.md#youyour-instead-of-weour

@GodderE2D
Copy link
Contributor

Wait, you're making this change to reflect the command categories page, right? So why should we use a different approach than that page? I'd say either use fs here, or also make the categories page use glob.

@sdanialraza
Copy link
Contributor

I don't think changes like these are needed especially when the new guide is in the works.

@Jiralite
Copy link
Member

This portion of the guide is confusing because it does not work with a previous section title "Command Categories" which has the user move commands in to subcommand folders.

Just pointing out that this issue is resolved.

@Qjuh Qjuh mentioned this pull request Feb 14, 2024
@Jiralite Jiralite linked an issue Feb 14, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use glob instead of fs
6 participants