feat(permissions): Adds server permissions

This commit is contained in:
Michel Fedde 2025-06-24 20:58:46 +02:00
parent d46bbd84c5
commit cf9c88a2d6
24 changed files with 415 additions and 69 deletions

View file

@ -0,0 +1,24 @@
import {inlineCode} from "discord.js";
export class PermissionError extends Error {
shouldLog: boolean = false;
constructor(
message: string,
public readonly tryInstead: string | null = null
) {
super(message);
}
public getDiscordMessage(e: PermissionError): string {
let userMessage = `:x: You can not perform this action! ${inlineCode(e.message)}`
if (e.tryInstead) {
userMessage += `
You can try the following:
${inlineCode(e.tryInstead)}`
}
return userMessage;
}
}