Skip to content

Commit 9e2141f

Browse files
committed
added env file on package.json
1 parent 7e4e1b3 commit 9e2141f

3 files changed

Lines changed: 81 additions & 108 deletions

File tree

package-lock.json

Lines changed: 72 additions & 102 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"type": "module",
77
"scripts": {
88
"build": "tsc",
9-
"start": "node dist/index.js",
10-
"dev": "tsx src/index.ts"
9+
"start": "node --env-file=.env dist/index.js",
10+
"dev": "tsx --env-file=.env src/index.ts"
1111
},
1212
"keywords": [],
1313
"author": "",

src/libs/loadCommands.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import * as fs from "fs";
1111
import * as path from "path";
1212
import { fileURLToPath, pathToFileURL } from "url";
1313
import { logger } from "./logger.js";
14+
import chalk from "chalk";
1415

1516
export interface Command {
1617
data:
@@ -49,23 +50,25 @@ export async function loadCommands(
4950

5051
const rest = new REST().setToken(token);
5152

52-
if (clientId && guildId) {
53-
logger.info("here")
53+
if (guildId) {
54+
logger.info(`Loading Server (${chalk.grey(guildId)}) commands...`);
5455
await rest.put(Routes.applicationGuildCommands(clientId, guildId), {
5556
body: [],
5657
});
5758

5859
await rest.put(Routes.applicationGuildCommands(clientId, guildId), {
5960
body: commandData,
6061
});
61-
} else if (clientId) {
62-
logger.info("a")
62+
logger.info("Completed!");
63+
} else {
64+
logger.info("Loading Global commands...");
6365
await rest.put(Routes.applicationCommands(clientId), {
6466
body: [],
6567
});
6668

6769
await rest.put(Routes.applicationCommands(clientId), {
6870
body: commandData,
6971
});
72+
logger.info("Completed");
7073
}
7174
}

0 commit comments

Comments
 (0)