mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-19 01:03:58 +00:00
- The reload command now properly reloads configuration changes by skipping the configuration cache - The eval command now sends a file if the output is too long - The eval command now restricts access to the bot token by removing it and sandboxing the input code execution
25 lines
941 B
TypeScript
25 lines
941 B
TypeScript
import { ApplicationCommandOptionType } from 'discord.js'
|
|
|
|
import { AdminCommand } from '$/classes/Command'
|
|
import CommandError, { CommandErrorType } from '$/classes/CommandError'
|
|
|
|
export default new AdminCommand({
|
|
name: 'exception-test',
|
|
description: 'Makes the bot intentionally hate you by throwing an exception',
|
|
options: {
|
|
type: {
|
|
description: 'The type of exception to throw',
|
|
type: ApplicationCommandOptionType.String,
|
|
required: true,
|
|
choices: [
|
|
{ name: 'Process', value: 'Process' },
|
|
...Object.keys(CommandErrorType).map(k => ({ name: k, value: k })),
|
|
],
|
|
},
|
|
},
|
|
async execute(_, __, { type }) {
|
|
if (type === 'Process') throw new Error('Intentional process exception')
|
|
throw new CommandError(CommandErrorType[type as keyof typeof CommandErrorType], 'Intentional bot design') // ;)
|
|
},
|
|
})
|