···11import {
22- Attachment,
32 AttachmentBuilder,
43 ChatInputCommandInteraction,
54 SlashCommandBuilder,
65} from "discord.js";
77-import type { customClient } from "../..";
66+import type { customClient } from "../../index.ts";
87import { createDong } from "../../lib/dong-io.ts";
98import { download } from "../../lib/download.ts";
99+import { Buffer } from "node:buffer";
10101111export const data = new SlashCommandBuilder()
1212 .setName("create")
···47474848 await interaction.deferReply();
49495050- let downloaded = {
5050+ const downloaded = {
5151 image: await download(image),
5252 audio: await download(audio),
5353 };
+1
src/commands/dong/open.ts
···1010import { Mime } from "mime";
1111import standardTypes from "mime/types/standard.js";
1212import otherTypes from "mime/types/other.js";
1313+import { Buffer } from "node:buffer";
13141415const mime = new Mime(standardTypes, otherTypes);
1516mime.define({ "audio/mpeg": ["mp3"] });
+2-5
src/commands/util/ping.ts
···11-import {
22- ChatInputCommandInteraction,
33- SlashCommandBuilder,
44-} from "discord.js";
55-import type { customClient } from "../..";
11+import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
22+import type { customClient } from "../../index.ts";
6374export const data = new SlashCommandBuilder()
85 .setName("ping")
+7-5
src/index.ts
···88 type Interaction,
99} from "discord.js";
1010import { glob } from "node:fs/promises";
1111-import path from "node:path";
12111313-console.log(process.env);
1414-1515-const token = process.env.TOKEN;
1212+const token = Deno.env.get("TOKEN");
1613if (!token) throw new Error("Token required. Please fill in TOKEN in .env");
1714console.log("Token Valid!");
1815···4239for await (const file of glob("src/commands/**/*.ts", {
4340 exclude: ["node_modules"],
4441})) {
4545- const command = await import("file:///" + path.join(__dirname, "..", file));
4242+ console.log(file);
4343+ const command = await import(`../${file}`);
4644 // check command contains all required properties
4745 if (
4846 "data" in command &&
···7674 console.error(`No command ${interaction.commandName}`);
7775 return;
7876 }
7777+7878+ console.log(
7979+ `Got command /${interaction.commandName} from @${interaction.user.username}`
8080+ );
79818082 try {
8183 await command.execute(interaction);