reciple 6.0.0-dev.27 → 6.0.0-dev.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/bin.mjs +68 -67
- package/dist/lib/bin.mjs.map +1 -0
- package/dist/lib/esm.mjs +2 -1
- package/dist/lib/esm.mjs.map +1 -0
- package/dist/lib/index.js +34 -33
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/reciple/classes/RecipleClient.js +308 -307
- package/dist/lib/reciple/classes/RecipleClient.js.map +1 -0
- package/dist/lib/reciple/classes/RecipleConfig.js +107 -106
- package/dist/lib/reciple/classes/RecipleConfig.js.map +1 -0
- package/dist/lib/reciple/classes/RecipleModule.js +137 -94
- package/dist/lib/reciple/classes/RecipleModule.js.map +1 -0
- package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js +310 -309
- package/dist/lib/reciple/classes/builders/MessageCommandBuilder.js.map +1 -0
- package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js +127 -126
- package/dist/lib/reciple/classes/builders/MessageCommandOptionBuilder.js.map +1 -0
- package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js +247 -246
- package/dist/lib/reciple/classes/builders/SlashCommandBuilder.js.map +1 -0
- package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js +179 -178
- package/dist/lib/reciple/classes/managers/ApplicationCommandManager.js.map +1 -0
- package/dist/lib/reciple/classes/managers/CommandCooldownManager.js +100 -99
- package/dist/lib/reciple/classes/managers/CommandCooldownManager.js.map +1 -0
- package/dist/lib/reciple/classes/managers/CommandManager.js +65 -60
- package/dist/lib/reciple/classes/managers/CommandManager.js.map +1 -0
- package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js +26 -25
- package/dist/lib/reciple/classes/managers/MessageCommandOptionManager.js.map +1 -0
- package/dist/lib/reciple/classes/managers/ModuleManager.js +181 -180
- package/dist/lib/reciple/classes/managers/ModuleManager.js.map +1 -0
- package/dist/lib/reciple/flags.js +32 -31
- package/dist/lib/reciple/flags.js.map +1 -0
- package/dist/lib/reciple/permissions.js +31 -30
- package/dist/lib/reciple/permissions.js.map +1 -0
- package/dist/lib/reciple/types/builders.js +12 -11
- package/dist/lib/reciple/types/builders.js.map +1 -0
- package/dist/lib/reciple/types/commands.js +16 -15
- package/dist/lib/reciple/types/commands.js.map +1 -0
- package/dist/lib/reciple/types/paramOptions.js +3 -2
- package/dist/lib/reciple/types/paramOptions.js.map +1 -0
- package/dist/lib/reciple/util.js +72 -71
- package/dist/lib/reciple/util.js.map +1 -0
- package/dist/lib/reciple/version.js +48 -47
- package/dist/lib/reciple/version.js.map +1 -0
- package/dist/types/bin.d.mts +3 -2
- package/dist/types/bin.d.mts.map +1 -0
- package/dist/types/esm.d.mts +2 -1
- package/dist/types/esm.d.mts.map +1 -0
- package/dist/types/index.d.ts +18 -17
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/reciple/classes/RecipleClient.d.ts +115 -114
- package/dist/types/reciple/classes/RecipleClient.d.ts.map +1 -0
- package/dist/types/reciple/classes/RecipleConfig.d.ts +101 -100
- package/dist/types/reciple/classes/RecipleConfig.d.ts.map +1 -0
- package/dist/types/reciple/classes/RecipleModule.d.ts +88 -56
- package/dist/types/reciple/classes/RecipleModule.d.ts.map +1 -0
- package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts +190 -189
- package/dist/types/reciple/classes/builders/MessageCommandBuilder.d.ts.map +1 -0
- package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts +54 -53
- package/dist/types/reciple/classes/builders/MessageCommandOptionBuilder.d.ts.map +1 -0
- package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts +99 -98
- package/dist/types/reciple/classes/builders/SlashCommandBuilder.d.ts.map +1 -0
- package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts +54 -53
- package/dist/types/reciple/classes/managers/ApplicationCommandManager.d.ts.map +1 -0
- package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts +71 -70
- package/dist/types/reciple/classes/managers/CommandCooldownManager.d.ts.map +1 -0
- package/dist/types/reciple/classes/managers/CommandManager.d.ts +35 -34
- package/dist/types/reciple/classes/managers/CommandManager.d.ts.map +1 -0
- package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts +23 -22
- package/dist/types/reciple/classes/managers/MessageCommandOptionManager.d.ts.map +1 -0
- package/dist/types/reciple/classes/managers/ModuleManager.d.ts +50 -49
- package/dist/types/reciple/classes/managers/ModuleManager.d.ts.map +1 -0
- package/dist/types/reciple/flags.d.ts +18 -17
- package/dist/types/reciple/flags.d.ts.map +1 -0
- package/dist/types/reciple/permissions.d.ts +16 -15
- package/dist/types/reciple/permissions.d.ts.map +1 -0
- package/dist/types/reciple/types/builders.d.ts +206 -205
- package/dist/types/reciple/types/builders.d.ts.map +1 -0
- package/dist/types/reciple/types/commands.d.ts +82 -81
- package/dist/types/reciple/types/commands.d.ts.map +1 -0
- package/dist/types/reciple/types/paramOptions.d.ts +102 -101
- package/dist/types/reciple/types/paramOptions.d.ts.map +1 -0
- package/dist/types/reciple/util.d.ts +27 -26
- package/dist/types/reciple/util.d.ts.map +1 -0
- package/dist/types/reciple/version.d.ts +26 -25
- package/dist/types/reciple/version.d.ts.map +1 -0
- package/package.json +8 -6
|
@@ -1,114 +1,115 @@
|
|
|
1
|
-
import { Awaitable, ChatInputCommandInteraction, Client, ClientEvents, ClientOptions, Interaction, Message } from 'discord.js';
|
|
2
|
-
import { MessageCommandBuilder, MessageCommandExecuteData, MessageCommandHaltData } from './builders/MessageCommandBuilder';
|
|
3
|
-
import { SlashCommandExecuteData, SlashCommandHaltData } from './builders/SlashCommandBuilder';
|
|
4
|
-
import { AnyCommandExecuteData, AnyCommandHaltData } from '../types/commands';
|
|
5
|
-
import { CommandCooldownManager } from './managers/CommandCooldownManager';
|
|
6
|
-
import { AnySlashCommandBuilder } from '../types/builders';
|
|
7
|
-
import { ApplicationCommandManager } from './managers/ApplicationCommandManager';
|
|
8
|
-
import { CommandManager } from './managers/CommandManager';
|
|
9
|
-
import { ModuleManager } from './managers/ModuleManager';
|
|
10
|
-
import { Config } from './RecipleConfig';
|
|
11
|
-
import { Logger } from 'fallout-utility';
|
|
12
|
-
/**
|
|
13
|
-
* Options for {@link RecipleClient}
|
|
14
|
-
*/
|
|
15
|
-
export interface RecipleClientOptions extends ClientOptions {
|
|
16
|
-
config?: Config;
|
|
17
|
-
cwd?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Reciple client events
|
|
21
|
-
*/
|
|
22
|
-
export interface RecipleClientEvents extends ClientEvents {
|
|
23
|
-
recipleCommandExecute: [executeData: AnyCommandExecuteData];
|
|
24
|
-
recipleCommandHalt: [haltData: AnyCommandHaltData];
|
|
25
|
-
recipleRegisterApplicationCommands: [];
|
|
26
|
-
recipleReplyError: [error: unknown];
|
|
27
|
-
}
|
|
28
|
-
export declare enum RecipleEvents {
|
|
29
|
-
RecipleCommandExecute = "recipleCommandExecute",
|
|
30
|
-
RecipleCommandHalt = "recipleCommandHalt",
|
|
31
|
-
RecipleRegisterApplicationCommands = "recipleRegisterApplicationCommands",
|
|
32
|
-
RecipleReplyError = "recipleReplyError",
|
|
33
|
-
CommandExecute = "recipleCommandExecute",
|
|
34
|
-
CommandHalt = "recipleCommandHalt",
|
|
35
|
-
RegisterApplicationCommands = "recipleRegisterApplicationCommands",
|
|
36
|
-
ReplyError = "recipleReplyError"
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Reciple client
|
|
40
|
-
*/
|
|
41
|
-
export interface RecipleClient<Ready extends boolean = boolean> extends Client<Ready> {
|
|
42
|
-
on<E extends keyof RecipleClientEvents>(event: E, listener: (...args: RecipleClientEvents[E]) => Awaitable<void>): this;
|
|
43
|
-
on<E extends string | symbol>(event: E, listener: (...args: any) => Awaitable<void>): this;
|
|
44
|
-
once<E extends keyof RecipleClientEvents>(event: E, listener: (...args: RecipleClientEvents[E]) => Awaitable<void>): this;
|
|
45
|
-
once<E extends keyof string | symbol>(event: E, listener: (...args: any) => Awaitable<void>): this;
|
|
46
|
-
emit<E extends keyof RecipleClientEvents>(event: E, ...args: RecipleClientEvents[E]): boolean;
|
|
47
|
-
emit<E extends string | symbol>(event: E, ...args: any): boolean;
|
|
48
|
-
off<E extends keyof RecipleClientEvents>(event: E, listener: (...args: RecipleClientEvents[E]) => Awaitable<void>): this;
|
|
49
|
-
off<E extends string | symbol>(event: E, listener: (...args: any) => Awaitable<void>): this;
|
|
50
|
-
removeAllListeners<E extends keyof RecipleClientEvents>(event?: E): this;
|
|
51
|
-
removeAllListeners(event?: string | symbol): this;
|
|
52
|
-
isReady(): this is RecipleClient<true>;
|
|
53
|
-
}
|
|
54
|
-
export declare class RecipleClient<Ready extends boolean = boolean> extends Client<Ready> {
|
|
55
|
-
readonly config: Config;
|
|
56
|
-
readonly commands: CommandManager;
|
|
57
|
-
readonly applicationCommands: ApplicationCommandManager;
|
|
58
|
-
readonly cooldowns: CommandCooldownManager;
|
|
59
|
-
readonly modules: ModuleManager;
|
|
60
|
-
readonly cwd: string;
|
|
61
|
-
readonly logger: Logger;
|
|
62
|
-
readonly version: string;
|
|
63
|
-
get isClientLogsSilent(): boolean;
|
|
64
|
-
/**
|
|
65
|
-
* @param options Client options
|
|
66
|
-
*/
|
|
67
|
-
constructor(options: RecipleClientOptions);
|
|
68
|
-
/**
|
|
69
|
-
* Listed to command executions
|
|
70
|
-
*/
|
|
71
|
-
addCommandListeners(): RecipleClient<Ready>;
|
|
72
|
-
/**
|
|
73
|
-
* Execute a slash command
|
|
74
|
-
* @param interaction Slash command interaction
|
|
75
|
-
*/
|
|
76
|
-
slashCommandExecute(interaction: Interaction | ChatInputCommandInteraction): Promise<undefined | SlashCommandExecuteData>;
|
|
77
|
-
/**
|
|
78
|
-
* Execute a Message command
|
|
79
|
-
* @param message Message command executor
|
|
80
|
-
* @param prefix Message command prefix
|
|
81
|
-
*/
|
|
82
|
-
messageCommandExecute(message: Message, prefix?: string): Promise<undefined | MessageCommandExecuteData>;
|
|
83
|
-
/**
|
|
84
|
-
* Get a message from config
|
|
85
|
-
* @param messageKey Config messages key
|
|
86
|
-
* @param defaultMessage Default message when the key does not exists
|
|
87
|
-
*/
|
|
88
|
-
getConfigMessage<T = unknown>(messageKey: string, defaultMessage?: T): T;
|
|
89
|
-
/**
|
|
90
|
-
* Emits the {@link RecipleClientEvents["recipleReplyError"]} event
|
|
91
|
-
* @param error Received Error
|
|
92
|
-
*/
|
|
93
|
-
protected _replyError(error: unknown): void;
|
|
94
|
-
/**
|
|
95
|
-
* Executes command halt function
|
|
96
|
-
* @param command Halted command's builder
|
|
97
|
-
* @param haltData Halted command's data
|
|
98
|
-
*/
|
|
99
|
-
protected _haltCommand(command: AnySlashCommandBuilder, haltData: SlashCommandHaltData): Promise<boolean>;
|
|
100
|
-
protected _haltCommand(command: MessageCommandBuilder, haltData: MessageCommandHaltData): Promise<boolean>;
|
|
101
|
-
/**
|
|
102
|
-
* Executes a command's {@link SharedCommandBuilderProperties["execute"]} method
|
|
103
|
-
* @param command Command builder
|
|
104
|
-
* @param executeData Command execute data
|
|
105
|
-
*/
|
|
106
|
-
protected _executeCommand(command: AnySlashCommandBuilder, executeData: SlashCommandExecuteData): Promise<SlashCommandExecuteData | undefined>;
|
|
107
|
-
protected _executeCommand(command: MessageCommandBuilder, executeData: MessageCommandExecuteData): Promise<MessageCommandExecuteData | undefined>;
|
|
108
|
-
/**
|
|
109
|
-
* Error message when a command fails to execute
|
|
110
|
-
* @param err Received error
|
|
111
|
-
* @param command Slash/Message command execute data
|
|
112
|
-
*/
|
|
113
|
-
protected _commandExecuteError(err: Error, command: AnyCommandExecuteData): Promise<void>;
|
|
114
|
-
}
|
|
1
|
+
import { Awaitable, ChatInputCommandInteraction, Client, ClientEvents, ClientOptions, Interaction, Message } from 'discord.js';
|
|
2
|
+
import { MessageCommandBuilder, MessageCommandExecuteData, MessageCommandHaltData } from './builders/MessageCommandBuilder';
|
|
3
|
+
import { SlashCommandExecuteData, SlashCommandHaltData } from './builders/SlashCommandBuilder';
|
|
4
|
+
import { AnyCommandExecuteData, AnyCommandHaltData } from '../types/commands';
|
|
5
|
+
import { CommandCooldownManager } from './managers/CommandCooldownManager';
|
|
6
|
+
import { AnySlashCommandBuilder } from '../types/builders';
|
|
7
|
+
import { ApplicationCommandManager } from './managers/ApplicationCommandManager';
|
|
8
|
+
import { CommandManager } from './managers/CommandManager';
|
|
9
|
+
import { ModuleManager } from './managers/ModuleManager';
|
|
10
|
+
import { Config } from './RecipleConfig';
|
|
11
|
+
import { Logger } from 'fallout-utility';
|
|
12
|
+
/**
|
|
13
|
+
* Options for {@link RecipleClient}
|
|
14
|
+
*/
|
|
15
|
+
export interface RecipleClientOptions extends ClientOptions {
|
|
16
|
+
config?: Config;
|
|
17
|
+
cwd?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Reciple client events
|
|
21
|
+
*/
|
|
22
|
+
export interface RecipleClientEvents extends ClientEvents {
|
|
23
|
+
recipleCommandExecute: [executeData: AnyCommandExecuteData];
|
|
24
|
+
recipleCommandHalt: [haltData: AnyCommandHaltData];
|
|
25
|
+
recipleRegisterApplicationCommands: [];
|
|
26
|
+
recipleReplyError: [error: unknown];
|
|
27
|
+
}
|
|
28
|
+
export declare enum RecipleEvents {
|
|
29
|
+
RecipleCommandExecute = "recipleCommandExecute",
|
|
30
|
+
RecipleCommandHalt = "recipleCommandHalt",
|
|
31
|
+
RecipleRegisterApplicationCommands = "recipleRegisterApplicationCommands",
|
|
32
|
+
RecipleReplyError = "recipleReplyError",
|
|
33
|
+
CommandExecute = "recipleCommandExecute",
|
|
34
|
+
CommandHalt = "recipleCommandHalt",
|
|
35
|
+
RegisterApplicationCommands = "recipleRegisterApplicationCommands",
|
|
36
|
+
ReplyError = "recipleReplyError"
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Reciple client
|
|
40
|
+
*/
|
|
41
|
+
export interface RecipleClient<Ready extends boolean = boolean> extends Client<Ready> {
|
|
42
|
+
on<E extends keyof RecipleClientEvents>(event: E, listener: (...args: RecipleClientEvents[E]) => Awaitable<void>): this;
|
|
43
|
+
on<E extends string | symbol>(event: E, listener: (...args: any) => Awaitable<void>): this;
|
|
44
|
+
once<E extends keyof RecipleClientEvents>(event: E, listener: (...args: RecipleClientEvents[E]) => Awaitable<void>): this;
|
|
45
|
+
once<E extends keyof string | symbol>(event: E, listener: (...args: any) => Awaitable<void>): this;
|
|
46
|
+
emit<E extends keyof RecipleClientEvents>(event: E, ...args: RecipleClientEvents[E]): boolean;
|
|
47
|
+
emit<E extends string | symbol>(event: E, ...args: any): boolean;
|
|
48
|
+
off<E extends keyof RecipleClientEvents>(event: E, listener: (...args: RecipleClientEvents[E]) => Awaitable<void>): this;
|
|
49
|
+
off<E extends string | symbol>(event: E, listener: (...args: any) => Awaitable<void>): this;
|
|
50
|
+
removeAllListeners<E extends keyof RecipleClientEvents>(event?: E): this;
|
|
51
|
+
removeAllListeners(event?: string | symbol): this;
|
|
52
|
+
isReady(): this is RecipleClient<true>;
|
|
53
|
+
}
|
|
54
|
+
export declare class RecipleClient<Ready extends boolean = boolean> extends Client<Ready> {
|
|
55
|
+
readonly config: Config;
|
|
56
|
+
readonly commands: CommandManager;
|
|
57
|
+
readonly applicationCommands: ApplicationCommandManager;
|
|
58
|
+
readonly cooldowns: CommandCooldownManager;
|
|
59
|
+
readonly modules: ModuleManager;
|
|
60
|
+
readonly cwd: string;
|
|
61
|
+
readonly logger: Logger;
|
|
62
|
+
readonly version: string;
|
|
63
|
+
get isClientLogsSilent(): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* @param options Client options
|
|
66
|
+
*/
|
|
67
|
+
constructor(options: RecipleClientOptions);
|
|
68
|
+
/**
|
|
69
|
+
* Listed to command executions
|
|
70
|
+
*/
|
|
71
|
+
addCommandListeners(): RecipleClient<Ready>;
|
|
72
|
+
/**
|
|
73
|
+
* Execute a slash command
|
|
74
|
+
* @param interaction Slash command interaction
|
|
75
|
+
*/
|
|
76
|
+
slashCommandExecute(interaction: Interaction | ChatInputCommandInteraction): Promise<undefined | SlashCommandExecuteData>;
|
|
77
|
+
/**
|
|
78
|
+
* Execute a Message command
|
|
79
|
+
* @param message Message command executor
|
|
80
|
+
* @param prefix Message command prefix
|
|
81
|
+
*/
|
|
82
|
+
messageCommandExecute(message: Message, prefix?: string): Promise<undefined | MessageCommandExecuteData>;
|
|
83
|
+
/**
|
|
84
|
+
* Get a message from config
|
|
85
|
+
* @param messageKey Config messages key
|
|
86
|
+
* @param defaultMessage Default message when the key does not exists
|
|
87
|
+
*/
|
|
88
|
+
getConfigMessage<T = unknown>(messageKey: string, defaultMessage?: T): T;
|
|
89
|
+
/**
|
|
90
|
+
* Emits the {@link RecipleClientEvents["recipleReplyError"]} event
|
|
91
|
+
* @param error Received Error
|
|
92
|
+
*/
|
|
93
|
+
protected _replyError(error: unknown): void;
|
|
94
|
+
/**
|
|
95
|
+
* Executes command halt function
|
|
96
|
+
* @param command Halted command's builder
|
|
97
|
+
* @param haltData Halted command's data
|
|
98
|
+
*/
|
|
99
|
+
protected _haltCommand(command: AnySlashCommandBuilder, haltData: SlashCommandHaltData): Promise<boolean>;
|
|
100
|
+
protected _haltCommand(command: MessageCommandBuilder, haltData: MessageCommandHaltData): Promise<boolean>;
|
|
101
|
+
/**
|
|
102
|
+
* Executes a command's {@link SharedCommandBuilderProperties["execute"]} method
|
|
103
|
+
* @param command Command builder
|
|
104
|
+
* @param executeData Command execute data
|
|
105
|
+
*/
|
|
106
|
+
protected _executeCommand(command: AnySlashCommandBuilder, executeData: SlashCommandExecuteData): Promise<SlashCommandExecuteData | undefined>;
|
|
107
|
+
protected _executeCommand(command: MessageCommandBuilder, executeData: MessageCommandExecuteData): Promise<MessageCommandExecuteData | undefined>;
|
|
108
|
+
/**
|
|
109
|
+
* Error message when a command fails to execute
|
|
110
|
+
* @param err Received error
|
|
111
|
+
* @param command Slash/Message command execute data
|
|
112
|
+
*/
|
|
113
|
+
protected _commandExecuteError(err: Error, command: AnyCommandExecuteData): Promise<void>;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=RecipleClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecipleClient.d.ts","sourceRoot":"","sources":["../../../../src/reciple/classes/RecipleClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,2BAA2B,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAU,WAAW,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACpJ,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC5H,OAAO,EAAuB,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACpH,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAqB,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAkB,MAAM,mCAAmC,CAAC;AAC3F,OAAO,EAAqB,sBAAsB,EAAe,MAAM,mBAAmB,CAAC;AAG3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAiB,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAc,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAKrD;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACrD,qBAAqB,EAAE,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC;IAC5D,kBAAkB,EAAE,CAAC,QAAQ,EAAE,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
*/
|
|
5
|
-
export interface ConfigCommandPermissions {
|
|
6
|
-
/**
|
|
7
|
-
* Command name
|
|
8
|
-
*/
|
|
9
|
-
command: string;
|
|
10
|
-
/**
|
|
11
|
-
* Override command builder permissions
|
|
12
|
-
*/
|
|
13
|
-
permissions: PermissionResolvable[];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Reciple config object interface
|
|
17
|
-
*/
|
|
18
|
-
export interface Config {
|
|
19
|
-
token: string;
|
|
20
|
-
commands: {
|
|
21
|
-
slashCommand: {
|
|
22
|
-
enabled: boolean;
|
|
23
|
-
replyOnError: boolean;
|
|
24
|
-
registerCommands: boolean;
|
|
25
|
-
allowRegisterEmptyCommandList: boolean;
|
|
26
|
-
enableCooldown: boolean;
|
|
27
|
-
setRequiredPermissions: boolean;
|
|
28
|
-
acceptRepliedInteractions: boolean;
|
|
29
|
-
guilds?: string[] | string;
|
|
30
|
-
permissions: {
|
|
31
|
-
enabled: boolean;
|
|
32
|
-
commands: ConfigCommandPermissions[];
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
messageCommand: {
|
|
36
|
-
enabled: boolean;
|
|
37
|
-
prefix?: string;
|
|
38
|
-
replyOnError: boolean;
|
|
39
|
-
allowCommandAlias: boolean;
|
|
40
|
-
enableCooldown: boolean;
|
|
41
|
-
commandArgumentSeparator: string;
|
|
42
|
-
permissions: {
|
|
43
|
-
enabled: boolean;
|
|
44
|
-
commands: ConfigCommandPermissions[];
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
fileLogging: {
|
|
49
|
-
enabled: boolean;
|
|
50
|
-
debugmode: boolean;
|
|
51
|
-
clientLogs: boolean;
|
|
52
|
-
stringifyLoggedJSON: boolean;
|
|
53
|
-
logFilePath: string;
|
|
54
|
-
};
|
|
55
|
-
client: ClientOptions;
|
|
56
|
-
messages: {
|
|
57
|
-
[messageKey: string]: any;
|
|
58
|
-
};
|
|
59
|
-
ignoredFiles: string[];
|
|
60
|
-
modulesFolder: string | string[];
|
|
61
|
-
disableVersionCheck: boolean;
|
|
62
|
-
version: string;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Create/parse reciple config
|
|
66
|
-
*/
|
|
67
|
-
export declare class RecipleConfig {
|
|
68
|
-
config: Config;
|
|
69
|
-
configPath: string;
|
|
70
|
-
static defaultConfigPath: string;
|
|
71
|
-
/**
|
|
72
|
-
* @param configPath Path to config
|
|
73
|
-
*/
|
|
74
|
-
constructor(configPath: string);
|
|
75
|
-
/**
|
|
76
|
-
* Parse the config file
|
|
77
|
-
*/
|
|
78
|
-
parseConfig(): this;
|
|
79
|
-
/**
|
|
80
|
-
* Returns the parsed config file
|
|
81
|
-
*/
|
|
82
|
-
getConfig(): Config;
|
|
83
|
-
/**
|
|
84
|
-
* Parse token from config
|
|
85
|
-
* @param askIfEmpty Ask for token if the token is undefined
|
|
86
|
-
*/
|
|
87
|
-
parseToken(askIfEmpty?: boolean): string | null;
|
|
88
|
-
/**
|
|
89
|
-
* Check if the config version is supported
|
|
90
|
-
*/
|
|
91
|
-
protected _isSupportedConfig(): boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Ask for a token
|
|
94
|
-
*/
|
|
95
|
-
protected _askToken(): string | null;
|
|
96
|
-
/**
|
|
97
|
-
* Get default config
|
|
98
|
-
*/
|
|
99
|
-
static getDefaultConfig(): Config;
|
|
100
|
-
}
|
|
1
|
+
import { ClientOptions, PermissionResolvable } from 'discord.js';
|
|
2
|
+
/**
|
|
3
|
+
* Command permissions config object interface
|
|
4
|
+
*/
|
|
5
|
+
export interface ConfigCommandPermissions {
|
|
6
|
+
/**
|
|
7
|
+
* Command name
|
|
8
|
+
*/
|
|
9
|
+
command: string;
|
|
10
|
+
/**
|
|
11
|
+
* Override command builder permissions
|
|
12
|
+
*/
|
|
13
|
+
permissions: PermissionResolvable[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Reciple config object interface
|
|
17
|
+
*/
|
|
18
|
+
export interface Config {
|
|
19
|
+
token: string;
|
|
20
|
+
commands: {
|
|
21
|
+
slashCommand: {
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
replyOnError: boolean;
|
|
24
|
+
registerCommands: boolean;
|
|
25
|
+
allowRegisterEmptyCommandList: boolean;
|
|
26
|
+
enableCooldown: boolean;
|
|
27
|
+
setRequiredPermissions: boolean;
|
|
28
|
+
acceptRepliedInteractions: boolean;
|
|
29
|
+
guilds?: string[] | string;
|
|
30
|
+
permissions: {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
commands: ConfigCommandPermissions[];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
messageCommand: {
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
prefix?: string;
|
|
38
|
+
replyOnError: boolean;
|
|
39
|
+
allowCommandAlias: boolean;
|
|
40
|
+
enableCooldown: boolean;
|
|
41
|
+
commandArgumentSeparator: string;
|
|
42
|
+
permissions: {
|
|
43
|
+
enabled: boolean;
|
|
44
|
+
commands: ConfigCommandPermissions[];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
fileLogging: {
|
|
49
|
+
enabled: boolean;
|
|
50
|
+
debugmode: boolean;
|
|
51
|
+
clientLogs: boolean;
|
|
52
|
+
stringifyLoggedJSON: boolean;
|
|
53
|
+
logFilePath: string;
|
|
54
|
+
};
|
|
55
|
+
client: ClientOptions;
|
|
56
|
+
messages: {
|
|
57
|
+
[messageKey: string]: any;
|
|
58
|
+
};
|
|
59
|
+
ignoredFiles: string[];
|
|
60
|
+
modulesFolder: string | string[];
|
|
61
|
+
disableVersionCheck: boolean;
|
|
62
|
+
version: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Create/parse reciple config
|
|
66
|
+
*/
|
|
67
|
+
export declare class RecipleConfig {
|
|
68
|
+
config: Config;
|
|
69
|
+
configPath: string;
|
|
70
|
+
static defaultConfigPath: string;
|
|
71
|
+
/**
|
|
72
|
+
* @param configPath Path to config
|
|
73
|
+
*/
|
|
74
|
+
constructor(configPath: string);
|
|
75
|
+
/**
|
|
76
|
+
* Parse the config file
|
|
77
|
+
*/
|
|
78
|
+
parseConfig(): this;
|
|
79
|
+
/**
|
|
80
|
+
* Returns the parsed config file
|
|
81
|
+
*/
|
|
82
|
+
getConfig(): Config;
|
|
83
|
+
/**
|
|
84
|
+
* Parse token from config
|
|
85
|
+
* @param askIfEmpty Ask for token if the token is undefined
|
|
86
|
+
*/
|
|
87
|
+
parseToken(askIfEmpty?: boolean): string | null;
|
|
88
|
+
/**
|
|
89
|
+
* Check if the config version is supported
|
|
90
|
+
*/
|
|
91
|
+
protected _isSupportedConfig(): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Ask for a token
|
|
94
|
+
*/
|
|
95
|
+
protected _askToken(): string | null;
|
|
96
|
+
/**
|
|
97
|
+
* Get default config
|
|
98
|
+
*/
|
|
99
|
+
static getDefaultConfig(): Config;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=RecipleConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecipleConfig.d.ts","sourceRoot":"","sources":["../../../../src/reciple/classes/RecipleConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAQjE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,EAAE,oBAAoB,EAAE,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE;QACN,YAAY,EAAE;YACV,OAAO,EAAE,OAAO,CAAC;YACjB,YAAY,EAAE,OAAO,CAAC;YACtB,gBAAgB,EAAE,OAAO,CAAC;YAC1B,6BAA6B,EAAE,OAAO,CAAC;YACvC,cAAc,EAAE,O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,SAAS,IAAI,MAAM;IAO1B;;;OAGG;IACI,UAAU,CAAC,UAAU,GAAE,OAAc,GAAG,MAAM,GAAG,IAAI;IAY5D;;OAEG;IACH,SAAS,CAAC,kBAAkB,IAAI,OAAO;IAIvC;;OAEG;IACH,SAAS,CAAC,SAAS,IAAI,MAAM,GAAG,IAAI;IAapC;;OAEG;WACW,gBAAgB,IAAI,MAAM;CAK3C"}
|
|
@@ -1,56 +1,88 @@
|
|
|
1
|
-
import { AnyCommandBuilder, AnyCommandData } from '../types/builders';
|
|
2
|
-
import { GuildResolvable, RestOrArray } from 'discord.js';
|
|
3
|
-
import { RecipleClient } from './RecipleClient';
|
|
4
|
-
/**
|
|
5
|
-
* Reciple script object
|
|
6
|
-
*/
|
|
7
|
-
export interface RecipleScript {
|
|
8
|
-
/**
|
|
9
|
-
* Supported reciple versions
|
|
10
|
-
*/
|
|
11
|
-
versions: string | string[];
|
|
12
|
-
/**
|
|
13
|
-
* Module commands
|
|
14
|
-
*/
|
|
15
|
-
commands?: (AnyCommandBuilder | AnyCommandData)[];
|
|
16
|
-
/**
|
|
17
|
-
* Action on module start
|
|
18
|
-
* @param client Bot client
|
|
19
|
-
*/
|
|
20
|
-
onStart(client: RecipleClient<false>): boolean | Promise<boolean>;
|
|
21
|
-
/**
|
|
22
|
-
* Action on bot ready
|
|
23
|
-
* @param client Bot client
|
|
24
|
-
*/
|
|
25
|
-
onLoad?(client: RecipleClient<true>): void | Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Action when unloading this module
|
|
28
|
-
* @param reason Unload reason
|
|
29
|
-
* @param client Bot client
|
|
30
|
-
*/
|
|
31
|
-
onUnload?(reason: unknown, client: RecipleClient<true>): void | Promise<void>;
|
|
32
|
-
}
|
|
33
|
-
export interface RecipleModuleOptions<M = unknown> {
|
|
34
|
-
client: RecipleClient;
|
|
35
|
-
script: RecipleScript;
|
|
36
|
-
filePath?: string;
|
|
37
|
-
metadata?: M;
|
|
38
|
-
}
|
|
39
|
-
export declare class RecipleModule<M = unknown> {
|
|
40
|
-
readonly id: string;
|
|
41
|
-
readonly client: RecipleClient;
|
|
42
|
-
readonly commands: AnyCommandBuilder[];
|
|
43
|
-
readonly script: RecipleScript;
|
|
44
|
-
readonly filePath?: string;
|
|
45
|
-
metadata?: M;
|
|
46
|
-
get
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
import { AnyCommandBuilder, AnyCommandData } from '../types/builders';
|
|
2
|
+
import { GuildResolvable, RestOrArray } from 'discord.js';
|
|
3
|
+
import { RecipleClient } from './RecipleClient';
|
|
4
|
+
/**
|
|
5
|
+
* Reciple script object
|
|
6
|
+
*/
|
|
7
|
+
export interface RecipleScript {
|
|
8
|
+
/**
|
|
9
|
+
* Supported reciple versions
|
|
10
|
+
*/
|
|
11
|
+
versions: string | string[];
|
|
12
|
+
/**
|
|
13
|
+
* Module commands
|
|
14
|
+
*/
|
|
15
|
+
commands?: (AnyCommandBuilder | AnyCommandData)[];
|
|
16
|
+
/**
|
|
17
|
+
* Action on module start
|
|
18
|
+
* @param client Bot client
|
|
19
|
+
*/
|
|
20
|
+
onStart(client: RecipleClient<false>): boolean | Promise<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* Action on bot ready
|
|
23
|
+
* @param client Bot client
|
|
24
|
+
*/
|
|
25
|
+
onLoad?(client: RecipleClient<true>): void | Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Action when unloading this module
|
|
28
|
+
* @param reason Unload reason
|
|
29
|
+
* @param client Bot client
|
|
30
|
+
*/
|
|
31
|
+
onUnload?(reason: unknown, client: RecipleClient<true>): void | Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
export interface RecipleModuleOptions<M = unknown> {
|
|
34
|
+
client: RecipleClient;
|
|
35
|
+
script: RecipleScript;
|
|
36
|
+
filePath?: string;
|
|
37
|
+
metadata?: M;
|
|
38
|
+
}
|
|
39
|
+
export declare class RecipleModule<M = unknown> {
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly client: RecipleClient;
|
|
42
|
+
readonly commands: AnyCommandBuilder[];
|
|
43
|
+
readonly script: RecipleScript;
|
|
44
|
+
readonly filePath?: string;
|
|
45
|
+
metadata?: M;
|
|
46
|
+
get versions(): string | string[];
|
|
47
|
+
get onStart(): (client: RecipleClient<false>) => boolean | Promise<boolean>;
|
|
48
|
+
get onLoad(): ((client: RecipleClient<true>) => void | Promise<void>) | undefined;
|
|
49
|
+
get onUnload(): ((reason: unknown, client: RecipleClient<true>) => void | Promise<void>) | undefined;
|
|
50
|
+
get displayName(): string;
|
|
51
|
+
get isSupported(): boolean;
|
|
52
|
+
constructor(options: RecipleModuleOptions<M>);
|
|
53
|
+
/**
|
|
54
|
+
* Execute module's {@link RecipleScript.onStart}
|
|
55
|
+
*/
|
|
56
|
+
start(): Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Execute module's {@link RecipleScript.onLoad}
|
|
59
|
+
* @param resolveCommands Parse commands
|
|
60
|
+
*/
|
|
61
|
+
load(resolveCommands?: boolean): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Execute module's {@link RecipleScript.onUnload}
|
|
64
|
+
* @param reason Unload reason
|
|
65
|
+
*/
|
|
66
|
+
unload(reason?: any): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Register application commands from this module
|
|
69
|
+
* @param guilds Register to certain guilds
|
|
70
|
+
*/
|
|
71
|
+
registerSlashCommands(...guilds: RestOrArray<GuildResolvable>): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Unregister application commands from this module
|
|
74
|
+
* @param guilds Unregister from certain guilds
|
|
75
|
+
*/
|
|
76
|
+
unregisterSlashCommands(...guilds: RestOrArray<GuildResolvable>): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Update registered application commands of this module
|
|
79
|
+
* @param guilds update commands from certain guilds
|
|
80
|
+
*/
|
|
81
|
+
updateSlashCommands(...guilds: RestOrArray<GuildResolvable>): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Resolve module commands
|
|
84
|
+
*/
|
|
85
|
+
resolveCommands(): AnyCommandBuilder[];
|
|
86
|
+
toString(): string;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=RecipleModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecipleModule.d.ts","sourceRoot":"","sources":["../../../../src/reciple/classes/RecipleModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAe,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAkB,WAAW,EAAE,MAAM,YAAY,CAAC;AAI1E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,iBAAiB,GAAG,cAAc,CAAC,EAAE,CAAC;IAClD;;;OAGG;IACH,OAAO,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAClE;;;OAGG;IACH,MAAM,CAAC,CAAC,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D;;;;OAIG;IACH,QAAQ,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjF;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,OAAO;IAC7C,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,aAAa,CAAC;IACt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