Skip to content

Commit

Permalink
only create warn command if running in prod
Browse files Browse the repository at this point in the history
Signed-off-by: IThundxr <[email protected]>
  • Loading branch information
IThundxr committed Sep 3, 2023
1 parent 98e6f6b commit 0c79d16
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
DISCORD_TOKEN=
OWNER_ID=
SAY_LOGS_CHANNEL=
LOGS_CHANNEL=
MAVEN_REPO=
Expand Down
12 changes: 5 additions & 7 deletions src/commands/_commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import { warnCommand } from './moderation/warn.command';
import { sayCommand } from './util/say.command';
import { tagCommand } from './util/tag.command';

export const commands: Command[] = [
sayCommand,
tagCommand,
warnCommand,
listWarningsCommand,
deleteWarningCommand,
];
export const commands: Command[] = [sayCommand, tagCommand];

if (process.env.NODE_ENV !== 'development') {
commands.push(warnCommand, deleteWarningCommand, listWarningsCommand);
}

export default commands;
3 changes: 1 addition & 2 deletions src/types/environment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ declare global {
namespace NodeJS {
interface ProcessEnv {
DISCORD_TOKEN: string;
OWNER_ID: string;
SAY_LOGS_CHANNEL: string;
LOGS_CHANNEL: string;
MAVEN_REPO: string;
Expand All @@ -15,7 +14,7 @@ declare global {
FAIL_EMOJI: string;
WEBSERVER_PORT: string;
DATABASE_URL: string;
NODE_ENV: 'development' | 'production';
NODE_ENV: 'development' | 'dev-prod' | 'production';
}
}
}

0 comments on commit 0c79d16

Please sign in to comment.