Skip to content

Commit 5c93ee0

Browse files
authored
Follow-up changes to the Update command PR (#69)
Follow-up to #68
1 parent 3426df5 commit 5c93ee0

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/commands/update.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { SlashCommandBuilder } from 'discord.js';
22
import { exec as __unsafeExecuteCommand } from 'node:child_process';
3+
import { UserMessageError } from '../helpers/UserMessageError';
34
import { debug, error } from '../logger';
45

56
let numInvocations: number = 0;
@@ -14,13 +15,13 @@ export const update: GlobalCommand = {
1415
async execute({ replyPrivately, user, interaction }) {
1516
const admin_ids = process.env['ADMINISTRATORS']?.split(',');
1617
if (!admin_ids) {
17-
// TODO: make this a UserMessageException
18-
throw new Error('There is no ADMINISTRATORS variable. You must set ADMINISTRATORS in .env');
18+
throw new UserMessageError(
19+
'There is no ADMINISTRATORS variable. You must set ADMINISTRATORS in .env'
20+
);
1921
}
2022

2123
if (!admin_ids.includes(user.id)) {
22-
// TODO: make this a UserMessageException
23-
throw new Error(
24+
throw new UserMessageError(
2425
'You do not have permission to perform this command. Contact the bot administrator.'
2526
);
2627
}

0 commit comments

Comments
 (0)