From 4ae5989fd568a44b4dd057356b49c82011b926f2 Mon Sep 17 00:00:00 2001 From: mightypanders Date: Tue, 18 Apr 2023 23:44:31 +0200 Subject: [PATCH] add interfaces --- server/interfaces.ts | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/server/interfaces.ts b/server/interfaces.ts index 8e4464c..2595baa 100644 --- a/server/interfaces.ts +++ b/server/interfaces.ts @@ -1,29 +1,35 @@ +import { Collection } from "@discordjs/collection" +import { Role } from "discord.js" export type Maybe = T | undefined export interface Player { - name: string + name: string } export type supported_languages = "german" | "english" export interface localized_string { - [k: string]: { - [k in supported_languages]: string - } + [k: string]: { + [k in supported_languages]: string + } } export class CustomError extends Error { - private code: string - public constructor(message: string, errorCode: string) { - super(message) - this.code = errorCode - } - public getCode() { return this.code } + private code: string + public constructor(message: string, errorCode: string) { + super(message) + this.code = errorCode + } + public getCode() { return this.code } } export const errorCodes = { - 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", - + 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 + removedRoles: Collection +} +export type PermissionLevel = "VIEWER" | "ADMIN"