Ā© 2026 Hedgehog Software, LLC
this.error({ message: 'error' });
import { Precondition } from '@sapphire/framework'; import config from '#rootJson/config' assert { type: 'json' }; export class OwnerOnlyPrecondition extends Precondition { async messageRun(message) { // for message command return this.checkOwner(message.author.id); } async chatInputRun(interaction) { return this.checkOwner(interaction.user.id); } async contextMenuRun(interaction) { // for Context Menu Command return this.checkOwner(interaction.user.id); } async checkOwner(userId) { return config.owners.includes(userId) ? this.ok() : this.error({ message: 'Only the bot owner can use this command!' }); } }