feat: cleaned up directories

This commit is contained in:
TresAbhi committed 2023-05-13 22:01:58 +00:00
1 parent 473ebfa46c
commit 613527e78f
41 files changed
+116 -832

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
import { argv } from 'process';
type ArgumentName = 'discord-token' | 'wargaming-application-id';
export const args: Record<ArgumentName, string> = {
'discord-token': '',
'wargaming-application-id': '',
};
argv.forEach((arg) => {
if (arg.includes('=')) {
const [name, value] = arg.split('=');
args[name as ArgumentName] = value;
}
});
Object.keys(args).forEach((arg) => {
if (args[arg as ArgumentName] === '') {
throw new Error(`Missing argument: ${arg}`);
}
});
+6
View File
@@ -0,0 +1,6 @@
import discord from '../../../discord.json' assert { type: 'json' };
import isDev from './isDev.js';
export default function getClientId() {
return isDev() ? discord.client_id_dev : discord.client_id;
}
+5
View File
@@ -0,0 +1,5 @@
const isDevBoolean = process.argv.includes('--dev');
export default function isDev() {
return isDevBoolean;
}