feat(permissions): Adds server permissions
This commit is contained in:
parent
d46bbd84c5
commit
cf9c88a2d6
24 changed files with 415 additions and 69 deletions
|
|
@ -1,4 +1,9 @@
|
|||
import {inlineCode} from "discord.js";
|
||||
|
||||
export class UserError extends Error {
|
||||
|
||||
shouldLog: boolean = false;
|
||||
|
||||
constructor(
|
||||
message: string,
|
||||
public readonly tryInstead: string | null = null
|
||||
|
|
@ -7,4 +12,15 @@ export class UserError extends Error {
|
|||
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue