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

Allow non-command/event files to be put in the same dir #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/templates/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export async function registerCommands(client: DiscordClient, dir: string = '')
for (const file of files) {
const stat = await fs.lstat(path.join(filePath, file));
if (stat.isDirectory()) registerCommands(client, path.join(dir, file));
if (file.endsWith('.js') || file.endsWith('.ts')) {
if (file.endsWith('Command.js') || file.endsWith('Command.ts')) {
const { default: Command } = await import(path.join(dir, file));
const command = new Command();
client.commands.set(command.getName(), command);
Expand All @@ -93,7 +93,7 @@ export async function registerEvents(client: DiscordClient, dir: string = '') {
for (const file of files) {
const stat = await fs.lstat(path.join(filePath, file));
if (stat.isDirectory()) registerEvents(client, path.join(dir, file));
if (file.endsWith('.js') || file.endsWith('.ts')) {
if (file.endsWith('Event.js') || file.endsWith('Event.ts')) {
const { default: Event } = await import(path.join(dir, file));
const event = new Event();
client.events.set(event.getName(), event);
Expand Down