How can i make a class called ModerationCommand which automatically checks if the user is a staff member and if not then returns an error so that i dont have to implement the checking in every moderation command file
Solution
import { Command } from '@sapphire/framework';export abstract class ModerationCommand extends Command { public constructor(context: Command.Context, options: Command.Options) { super(context, { preconditions: ['Moderator', ...options.preconditions], ...options }); }}
import { Command } from '@sapphire/framework';export abstract class ModerationCommand extends Command { public constructor(context: Command.Context, options: Command.Options) { super(context, { preconditions: ['Moderator', ...options.preconditions], ...options }); }}