···5 SlashCommandBuilder,
6} from "discord.js";
7import type { customClient } from "../..";
8-import { createDong } from "../../lib/dong-io";
9-import { download } from "../../lib/download";
1011export const data = new SlashCommandBuilder()
12 .setName("create")
···5 SlashCommandBuilder,
6} from "discord.js";
7import type { customClient } from "../..";
8+import { createDong } from "../../lib/dong-io.ts";
9+import { download } from "../../lib/download.ts";
1011export const data = new SlashCommandBuilder()
12 .setName("create")
+2-2
src/commands/dong/open.ts
···5 SlashCommandBuilder,
6} from "discord.js";
7import type { customClient } from "../..";
8-import { download } from "../../lib/download";
9-import { readDong } from "../../lib/dong-io";
10import { Mime } from "mime";
11import standardTypes from "mime/types/standard.js";
12import otherTypes from "mime/types/other.js";
···5 SlashCommandBuilder,
6} from "discord.js";
7import type { customClient } from "../..";
8+import { download } from "../../lib/download.ts";
9+import { readDong } from "../../lib/dong-io.ts";
10import { Mime } from "mime";
11import standardTypes from "mime/types/standard.js";
12import otherTypes from "mime/types/other.js";
+11-4
src/index.ts
···7 MessageFlags,
8 type Interaction,
9} from "discord.js";
10-import { Glob } from "bun";
0001112const token = process.env.token;
13if (!token) throw new Error("Token required. Please fill in TOKEN in .env");
14console.log("Token Valid!");
001516// client typing
17export type customClient = Client & {
···3435// setup commands
36client.commands = new Collection();
37-const commandGlob = new Glob("**/*.ts");
38-for await (const file of commandGlob.scan("./src/commands")) {
39- const command = await import("./commands/" + file);
0040 // check command contains all required properties
41 if (
42 "data" in command &&
···7 MessageFlags,
8 type Interaction,
9} from "discord.js";
10+// import { Glob } from "bun";
11+import { glob } from "glob";
12+import "dotenv/config";
13+import path from "node:path";
1415const token = process.env.token;
16if (!token) throw new Error("Token required. Please fill in TOKEN in .env");
17console.log("Token Valid!");
18+19+const __dirname = import.meta.dirname;
2021// client typing
22export type customClient = Client & {
···3940// setup commands
41client.commands = new Collection();
42+// const commandGlob = new Glob("**/*.ts");
43+for (const file of await glob("src/commands/**/*.ts", {
44+ ignore: "node_modules",
45+})) {
46+ const command = await import("file:///" + path.join(__dirname, "..", file));
47 // check command contains all required properties
48 if (
49 "data" in command &&