File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { SlashCommandBuilder } from 'discord.js' ;
22import { exec as __unsafeExecuteCommand } from 'node:child_process' ;
3+ import { UserMessageError } from '../helpers/UserMessageError' ;
34import { debug , error } from '../logger' ;
45
56let 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 }
You can’t perform that action at this time.
0 commit comments