chore: change start method
This commit is contained in:
parent
98f73591d1
commit
5cc110420b
|
@ -10,4 +10,4 @@ COPY src /app/src
|
||||||
|
|
||||||
RUN npm i
|
RUN npm i
|
||||||
|
|
||||||
CMD ["npm", "run", "run"]
|
CMD ["npm", "run", "start"]
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"run": "tsx src/index.ts",
|
"start": "tsx src/index.ts"
|
||||||
"register": "tsx src/index.ts --register"
|
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
23
src/index.ts
23
src/index.ts
|
@ -7,18 +7,6 @@ if (!TOKEN || !CLIENT_ID) {
|
||||||
}
|
}
|
||||||
import commands from "./commands.ts";
|
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 {
|
import {
|
||||||
REST,
|
REST,
|
||||||
Routes,
|
Routes,
|
||||||
|
@ -28,6 +16,17 @@ import {
|
||||||
Events,
|
Events,
|
||||||
TextChannel,
|
TextChannel,
|
||||||
} from "discord.js";
|
} 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";
|
import { writeConfig, readConfig } from "./config.ts";
|
||||||
const client = new Client({
|
const client = new Client({
|
||||||
intents: [
|
intents: [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user