diff --git a/Dockerfile b/Dockerfile index 0241e11..1612283 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,4 +10,4 @@ COPY src /app/src RUN npm i -CMD ["npm", "run", "run"] \ No newline at end of file +CMD ["npm", "run", "start"] \ No newline at end of file diff --git a/package.json b/package.json index feee4ad..0415edc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,6 @@ { "scripts": { - "run": "tsx src/index.ts", - "register": "tsx src/index.ts --register" + "start": "tsx src/index.ts" }, "type": "module", "dependencies": { diff --git a/src/index.ts b/src/index.ts index 2d789f3..9cddf3d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,18 +7,6 @@ if (!TOKEN || !CLIENT_ID) { } import commands from "./commands.ts"; -if (process.argv.includes("--register")) { - const rest = new REST({ version: "10" }).setToken(TOKEN); - try { - console.log("refreshing slash commands..."); - await rest.put(Routes.applicationCommands(CLIENT_ID), { body: commands }); - console.log("OK"); - } catch (error) { - console.error(error); - } - process.exit(); -} - import { REST, Routes, @@ -28,6 +16,17 @@ import { Events, TextChannel, } from "discord.js"; + +const rest = new REST({ version: "10" }).setToken(TOKEN); +try { + console.log("refreshing slash commands..."); + await rest.put(Routes.applicationCommands(CLIENT_ID), { body: commands }); + console.log("OK"); +} catch (error) { + console.error(error); +} +process.exit(); + import { writeConfig, readConfig } from "./config.ts"; const client = new Client({ intents: [