Skip to content

Commit 2ee62c7

Browse files
TimeraaBas950
andcommitted
🚧 WIP
Co-authored-by: Bas950 <me@bas950.com>
1 parent 4ba1b88 commit 2ee62c7

23 files changed

Lines changed: 847 additions & 0 deletions

lib/classes/BaseClass.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default class BaseClass {
2+
disabled: boolean;
3+
enable(): void;
4+
disable(): void;
5+
}

lib/classes/BaseClass.js

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/classes/BaseClass.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/classes/Command.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import BaseClass from "./BaseClass";
2+
import type { ApplicationCommandOptionData, ApplicationCommandPermissionData, Awaitable, ChatInputApplicationCommandData, CommandInteraction, Snowflake, ContextMenuInteraction } from "discord.js";
3+
import type { ApplicationCommandTypes } from "discord.js/typings/enums";
4+
export default class Command extends BaseClass {
5+
global: boolean;
6+
name: string;
7+
description: string;
8+
defaultPermission?: boolean;
9+
type?: "CHAT_INPUT" | ApplicationCommandTypes.CHAT_INPUT;
10+
options?: ApplicationCommandOptionData[];
11+
cooldown?: number;
12+
channelAllowlist?: Snowflake[];
13+
channelDenylist?: Snowflake[];
14+
permissions?: ApplicationCommandPermissionData[];
15+
hasUserCommand?: boolean;
16+
execute: (interaction: CommandInteraction | ContextMenuInteraction) => Awaitable<void>;
17+
constructor(options: CommandOptions);
18+
}
19+
export interface CommandOptions extends ChatInputApplicationCommandData {
20+
cooldown?: number;
21+
channelAllowlist?: Snowflake[];
22+
channelDenylist?: Snowflake[];
23+
permissions?: ApplicationCommandPermissionData[];
24+
hasUserCommand?: boolean;
25+
execute(interaction: CommandInteraction | ContextMenuInteraction): Awaitable<void>;
26+
}

lib/classes/Command.js

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/classes/Command.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/classes/Event.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import BaseClass from "./BaseClass";
2+
import type { Awaitable, ClientEvents } from "discord.js";
3+
export default class Event<K extends keyof ClientEvents> extends BaseClass {
4+
event: K;
5+
listener: (...args: ClientEvents[K]) => Awaitable<void>;
6+
constructor(event: K, listener: (...args: ClientEvents[K]) => Awaitable<void>);
7+
}

lib/classes/Event.js

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/classes/Event.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/classes/ModuleLoader.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import debug from "debug";
2+
import { Collection } from "discord.js";
3+
import Command from "./Command";
4+
import type { Client } from "discord.js";
5+
export interface ModuleLoaderOptions {
6+
disallowedChannelMessage: string;
7+
commandCooldownMessage: string;
8+
}
9+
export default class DiscordModuleLoader {
10+
client: Client;
11+
disallowedChannelMessage: string;
12+
commandCooldownMessage: string;
13+
commands: Collection<string, Command>;
14+
cooldowns: Collection<string, Collection<string, number>>;
15+
log: debug.Debugger;
16+
constructor(client: Client, options?: ModuleLoaderOptions);
17+
loadModule(dir?: string): Promise<void>;
18+
loadEvents(dir?: string): Promise<void>;
19+
loadCommands(dir?: string, globalCommands?: boolean): Promise<void>;
20+
updateSlashCommands(): Promise<void>;
21+
private handleInteraction;
22+
}

0 commit comments

Comments
 (0)