Archived
removed ugly formatting
This commit is contained in:
1 parent
1938e4c12f
commit
6a0b8f3197
6 files changed
-15
No files matched your search
@@ -9,7 +9,6 @@ import { ParameterType } from "./types/Parameter.js";
|
|||||||
*/
|
*/
|
||||||
export class PermissionsError extends Error {
|
export class PermissionsError extends Error {
|
||||||
private readonly command: BaseCommand;
|
private readonly command: BaseCommand;
|
||||||
|
|
||||||
private readonly user: GuildMember | null;
|
private readonly user: GuildMember | null;
|
||||||
|
|
||||||
constructor(command: BaseCommand, user?: GuildMember | null) {
|
constructor(command: BaseCommand, user?: GuildMember | null) {
|
||||||
@@ -29,7 +28,6 @@ export class PermissionsError extends Error {
|
|||||||
*/
|
*/
|
||||||
export class ParameterTypeError extends TypeError {
|
export class ParameterTypeError extends TypeError {
|
||||||
private readonly stringContent: string;
|
private readonly stringContent: string;
|
||||||
|
|
||||||
private readonly type: ParameterType;
|
private readonly type: ParameterType;
|
||||||
|
|
||||||
constructor(s: string, type: ParameterType) {
|
constructor(s: string, type: ParameterType) {
|
||||||
|
|||||||
@@ -13,9 +13,7 @@ import { CommandType } from "../types/BaseCommand.js";
|
|||||||
*/
|
*/
|
||||||
export class CommandManager {
|
export class CommandManager {
|
||||||
private readonly _chatCommandsList: TextCommand[] = [];
|
private readonly _chatCommandsList: TextCommand[] = [];
|
||||||
|
|
||||||
private readonly _messagesCommandsList: BaseCommand[] = [];
|
private readonly _messagesCommandsList: BaseCommand[] = [];
|
||||||
|
|
||||||
private readonly _userCommandsList: BaseCommand[] = [];
|
private readonly _userCommandsList: BaseCommand[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -47,9 +47,7 @@ export class BaseCommand {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
private readonly function: CommandFunction;
|
private readonly function: CommandFunction;
|
||||||
|
|
||||||
private readonly permissionChecker: (i: Message | CommandInteraction) => boolean;
|
private readonly permissionChecker: (i: Message | CommandInteraction) => boolean;
|
||||||
|
|
||||||
public static nameRegExp: RegExp = /^[a-zA-Z]{1,32}$/;
|
public static nameRegExp: RegExp = /^[a-zA-Z]{1,32}$/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -42,9 +42,7 @@ export class TextCommand extends BaseCommand {
|
|||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
*/
|
*/
|
||||||
public readonly slash: boolean;
|
public readonly slash: boolean;
|
||||||
|
|
||||||
public static nameRegExp: RegExp = /^[\w-]{1,32}$/;
|
public static nameRegExp: RegExp = /^[\w-]{1,32}$/;
|
||||||
|
|
||||||
public static descriptionRegExp: RegExp = /^[a-zA-Z]{1,100}$/;
|
public static descriptionRegExp: RegExp = /^[a-zA-Z]{1,100}$/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,15 +5,10 @@ import { PermissionCheckTypes, PermissionTypes } from "./permissions.js";
|
|||||||
|
|
||||||
export interface BaseCommandInit {
|
export interface BaseCommandInit {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
guilds?: string[];
|
guilds?: string[];
|
||||||
|
|
||||||
permissionCheck?: PermissionCheckTypes;
|
permissionCheck?: PermissionCheckTypes;
|
||||||
|
|
||||||
permissions?: PermissionTypes;
|
permissions?: PermissionTypes;
|
||||||
|
|
||||||
announceSuccess?: boolean;
|
announceSuccess?: boolean;
|
||||||
|
|
||||||
function: CommandFunction;
|
function: CommandFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ export interface TextCommandInit {
|
|||||||
|
|
||||||
export interface CommandMessageStructure {
|
export interface CommandMessageStructure {
|
||||||
command: TextCommand;
|
command: TextCommand;
|
||||||
|
|
||||||
parameters: InputParameter[];
|
parameters: InputParameter[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,6 +98,5 @@ export type GetMode = "ALL" | "PREFIX" | "NO_PREFIX";
|
|||||||
|
|
||||||
export interface PhraseOccurrenceData {
|
export interface PhraseOccurrenceData {
|
||||||
command: TextCommand;
|
command: TextCommand;
|
||||||
|
|
||||||
type: "NAME" | "ALIAS";
|
type: "NAME" | "ALIAS";
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user