2023-04-18 23:44:31 +02:00
|
|
|
import { Collection } from "@discordjs/collection"
|
|
|
|
import { Role } from "discord.js"
|
2023-04-15 22:06:35 +02:00
|
|
|
|
2023-04-20 20:54:07 +02:00
|
|
|
export type Maybe<T> = T | undefined | null
|
2023-04-15 22:06:35 +02:00
|
|
|
export interface Player {
|
2023-04-18 23:44:31 +02:00
|
|
|
name: string
|
2023-04-15 22:06:35 +02:00
|
|
|
}
|
|
|
|
export type supported_languages = "german" | "english"
|
|
|
|
export interface localized_string {
|
2023-04-18 23:44:31 +02:00
|
|
|
[k: string]: {
|
|
|
|
[k in supported_languages]: string
|
|
|
|
}
|
2023-04-15 22:06:35 +02:00
|
|
|
}
|
|
|
|
export class CustomError extends Error {
|
2023-04-18 23:44:31 +02:00
|
|
|
private code: string
|
|
|
|
public constructor(message: string, errorCode: string) {
|
|
|
|
super(message)
|
|
|
|
this.code = errorCode
|
|
|
|
}
|
|
|
|
public getCode() { return this.code }
|
2023-04-15 22:06:35 +02:00
|
|
|
}
|
|
|
|
export const errorCodes = {
|
2023-04-18 23:44:31 +02:00
|
|
|
no_end_date: 'no_end_date',
|
|
|
|
no_string_present: 'no_string_present',
|
|
|
|
no_schedule: 'no_schedule',
|
|
|
|
schedule_not_supported: 'schedule_not_supported',
|
|
|
|
no_repetition_amount: 'no_repetition_amount',
|
|
|
|
invalid_repetition_string: 'invalid_repetition_string',
|
|
|
|
no_creator_id: "no_creator_id",
|
|
|
|
}
|
|
|
|
export interface ChangedRoles {
|
|
|
|
addedRoles: Collection<string, Role>
|
|
|
|
removedRoles: Collection<string, Role>
|
2023-04-15 22:06:35 +02:00
|
|
|
}
|
2023-06-04 16:35:43 +02:00
|
|
|
export type PermissionLevel = "VIEWER" | "ADMIN" | "TEMPORARY"
|