chore: change start method

This commit is contained in:
Keisuke Hirata 2024-10-20 16:27:55 +09:00
parent 98f73591d1
commit 5cc110420b
3 changed files with 13 additions and 15 deletions

View File

@ -10,4 +10,4 @@ COPY src /app/src
RUN npm i
CMD ["npm", "run", "run"]
CMD ["npm", "run", "start"]

View File

@ -1,7 +1,6 @@
{
"scripts": {
"run": "tsx src/index.ts",
"register": "tsx src/index.ts --register"
"start": "tsx src/index.ts"
},
"type": "module",
"dependencies": {

View File

@ -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: [