mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
feat(bots/discord/commands): allow process exception in exception-test
This commit is contained in:
@@ -11,6 +11,10 @@ export default {
|
|||||||
option
|
option
|
||||||
.setName('type')
|
.setName('type')
|
||||||
.setDescription('The type of exception to throw')
|
.setDescription('The type of exception to throw')
|
||||||
|
.addChoices({
|
||||||
|
name: 'process exception',
|
||||||
|
value: 'Process',
|
||||||
|
})
|
||||||
.addChoices({
|
.addChoices({
|
||||||
name: 'generic error',
|
name: 'generic error',
|
||||||
value: 'Generic',
|
value: 'Generic',
|
||||||
@@ -36,10 +40,12 @@ export default {
|
|||||||
.setDMPermission(true)
|
.setDMPermission(true)
|
||||||
.toJSON(),
|
.toJSON(),
|
||||||
|
|
||||||
|
ownerOnly: true,
|
||||||
global: true,
|
global: true,
|
||||||
|
|
||||||
async execute(_, interaction) {
|
async execute(_, interaction) {
|
||||||
const type = interaction.options.getString('type', true)
|
const type = interaction.options.getString('type', true)
|
||||||
throw new CommandError(CommandErrorType[type as keyof typeof CommandErrorType], '[INTENTIONAL BOT DESIGN]')
|
if (type === 'Process') throw new Error('Intentional process exception')
|
||||||
|
throw new CommandError(CommandErrorType[type as keyof typeof CommandErrorType], 'Intentional bot design') // ;)
|
||||||
},
|
},
|
||||||
} satisfies Command
|
} satisfies Command
|
||||||
|
|||||||
Reference in New Issue
Block a user