import {inlineCode} from "discord.js"; export class UserError extends Error { shouldLog: boolean = false; constructor( message: string, public readonly tryInstead: string | null = null ) { super(message); } public getDiscordMessage(e: UserError): string { let userMessage = `:x: \`${e.message}\` - Please validate your request!` if (e.tryInstead) { userMessage += ` You can try the following: ${inlineCode(e.tryInstead)}` } return userMessage; } }