fixed problem with paths
This commit is contained in:
1 parent
6fa699a44b
commit
bb169c438a
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
import { MyClient } from "./assets/MyClient";
|
import { MyClient } from "./assets/MyClient";
|
||||||
|
|
||||||
const token = process.env.DISCORD_TOKEN || "NzgzNDQwMjU3NjE3MzYyOTQ1.X8axmQ.7SbjdCVkS4LhgqN1umsvx5ig7NM";
|
const token = process.env.DISCORD_TOKEN;
|
||||||
|
|
||||||
const client = new MyClient("./commands", "./events", "214422162906415106");
|
const client = new MyClient("./dist/commands", "./dist/events", "214422162906415106");
|
||||||
|
|
||||||
client.login(token);
|
client.login(token);
|
||||||
@@ -39,7 +39,7 @@ export class MyClient extends DiscordClient {
|
|||||||
const cmdFiles = readdirSync(`${commandsPath}/${dir}`).filter(file => file.endsWith(".js"));
|
const cmdFiles = readdirSync(`${commandsPath}/${dir}`).filter(file => file.endsWith(".js"));
|
||||||
|
|
||||||
for (const file of cmdFiles) {
|
for (const file of cmdFiles) {
|
||||||
import(`.${commandsPath}/${dir}/${file}`).then((command) => {
|
import(`../.${commandsPath}/${dir}/${file}`).then((command) => {
|
||||||
const name = command.data.name;
|
const name = command.data.name;
|
||||||
this.restCommands.push(command.data);
|
this.restCommands.push(command.data);
|
||||||
this.commands.set(name, command);
|
this.commands.set(name, command);
|
||||||
@@ -50,7 +50,7 @@ export class MyClient extends DiscordClient {
|
|||||||
const eventFiles = readdirSync(eventsPath).filter(file => file.endsWith(".js"));
|
const eventFiles = readdirSync(eventsPath).filter(file => file.endsWith(".js"));
|
||||||
|
|
||||||
for (const file of eventFiles) {
|
for (const file of eventFiles) {
|
||||||
import(`.${eventsPath}/${file}`).then((event) => {
|
import(`../.${eventsPath}/${file}`).then((event) => {
|
||||||
this.on(event.name, (...args: unknown[]) => {
|
this.on(event.name, (...args: unknown[]) => {
|
||||||
event.run(args, this);
|
event.run(args, this);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user