Compare commits

...

3 Commits

Author SHA1 Message Date
4738c6bea1 added examples to README 2024-01-26 14:21:31 +01:00
324973cc13 ignore example commands on run 2024-01-26 14:19:57 +01:00
56b43d8e16 added README instructions for template 2024-01-26 14:18:28 +01:00
3 changed files with 15 additions and 2 deletions

View File

@ -1 +1,14 @@
# A DiscordJS Template # A DiscordJS Template
## Getting started
- Clone this repository:
```
https://git.baipyr.us/Baipyrus/DiscordJS.git
```
- Remove example commands:
- Either permanently delete directory `commands/examples/`
- Or move `commands/examples/` elsewhere, commit deletion, add to [`.gitignore`](.gitignore) and move back in
- Look through, copy and/or modify the [examples](commands/examples/).
- Either read a [guide](https://discordjs.guide/)!
- Or read the [docs](https://discord.js.org/docs)!

View File

@ -40,7 +40,7 @@ readdirAsync(mainPath)
await Promise.all( await Promise.all(
categories.map(async (category) => { categories.map(async (category) => {
const catPath = join(mainPath, category); const catPath = join(mainPath, category);
const files = (await readdirAsync(catPath)).filter((file) => file.endsWith('.js')); const files = (await readdirAsync(catPath)).filter((file) => file.endsWith('.js') && !file.endsWith('.example.js'));
// For each command file // For each command file
return await Promise.all( return await Promise.all(
files.map(async (current) => { files.map(async (current) => {

View File

@ -38,7 +38,7 @@ readdirAsync(cmdPath)
categories.map(async (category) => { categories.map(async (category) => {
const catPath = join(cmdPath, category); const catPath = join(cmdPath, category);
const content = await readdirAsync(catPath); const content = await readdirAsync(catPath);
const files = content.filter((file) => file.endsWith('.js')); const files = content.filter((file) => file.endsWith('.js') && !file.endsWith('.example.js'));
// For each command file // For each command file
return await Promise.all( return await Promise.all(
files.map(async (current) => { files.map(async (current) => {