xernerx 3.4.3 → 3.5.0
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/README.md +10 -10
- package/dist/build/ContextCommandBuilder.js +93 -86
- package/dist/build/EventBuilder.js +34 -35
- package/dist/build/InhibitorBuilder.js +27 -27
- package/dist/build/MessageCommandBuilder.js +90 -78
- package/dist/build/SlashCommandBuilder.js +125 -118
- package/dist/client/XernerxClient.js +101 -83
- package/dist/handlers/CommandHandler.js +42 -42
- package/dist/handlers/EventHandler.js +16 -16
- package/dist/handlers/Handler.js +250 -250
- package/dist/handlers/InhibitorHandler.js +21 -21
- package/dist/main.cjs +2012 -0
- package/dist/main.js +42 -42
- package/dist/models/CommandArguments.js +121 -123
- package/dist/models/Events.js +294 -304
- package/dist/models/Extensions.js +23 -23
- package/dist/tools/XernerxError.js +8 -8
- package/dist/tools/package.js +37 -41
- package/dist/types/enums.js +35 -35
- package/dist/types/interfaces.js +1 -1
- package/dist/types/options.js +1 -1
- package/dist/types/types.js +1 -1
- package/dist/utils/ClientUtil.js +222 -218
- package/dist/utils/CommandUtil.js +248 -260
- package/dist/validators/CommandValidations.js +183 -185
- package/dist/validators/InhibitorValidations.js +42 -42
- package/dist/validators/Shapes.js +1 -0
- package/package.json +54 -39
- package/types/build/ContextCommandBuilder.d.ts +68 -0
- package/{dist → types}/build/EventBuilder.d.ts +21 -17
- package/{dist → types}/build/InhibitorBuilder.d.ts +19 -20
- package/types/build/MessageCommandBuilder.d.ts +59 -0
- package/types/build/SlashCommandBuilder.d.ts +64 -0
- package/{dist → types}/client/XernerxClient.d.ts +28 -28
- package/{dist → types}/handlers/CommandHandler.d.ts +27 -27
- package/{dist → types}/handlers/EventHandler.d.ts +13 -13
- package/{dist → types}/handlers/Handler.d.ts +57 -57
- package/{dist → types}/handlers/InhibitorHandler.d.ts +18 -18
- package/{dist → types}/main.d.ts +44 -30
- package/{dist → types}/models/CommandArguments.d.ts +17 -17
- package/{dist → types}/models/Events.d.ts +24 -24
- package/{dist → types}/models/Extensions.d.ts +7 -7
- package/{dist → types}/tools/XernerxError.d.ts +5 -5
- package/{dist → types}/tools/package.d.ts +38 -38
- package/types/types/enums.d.ts +44 -0
- package/{dist → types}/types/interfaces.d.ts +25 -25
- package/{dist → types}/types/options.d.ts +241 -206
- package/{dist → types}/types/types.d.ts +61 -32
- package/{dist → types}/utils/ClientUtil.d.ts +25 -25
- package/{dist → types}/utils/CommandUtil.d.ts +58 -56
- package/{dist → types}/validators/CommandValidations.d.ts +12 -7
- package/{dist → types}/validators/InhibitorValidations.d.ts +11 -11
- package/types/validators/Shapes.d.ts +1 -0
- package/dist/build/ContextCommandBuilder.d.ts +0 -42
- package/dist/build/MessageCommandBuilder.d.ts +0 -42
- package/dist/build/SlashCommandBuilder.d.ts +0 -40
- package/dist/build/XContextCommandBuilder.d.ts +0 -40
- package/dist/build/XContextCommandBuilder.js +0 -84
- package/dist/build/XEventBuilder.d.ts +0 -17
- package/dist/build/XEventBuilder.js +0 -35
- package/dist/build/XInhibitorBuilder.d.ts +0 -20
- package/dist/build/XInhibitorBuilder.js +0 -28
- package/dist/build/XMessageCommandBuilder.d.ts +0 -42
- package/dist/build/XMessageCommandBuilder.js +0 -80
- package/dist/build/XSlashCommandBuilder.d.ts +0 -36
- package/dist/build/XSlashCommandBuilder.js +0 -114
- package/dist/models/CommandValidations.d.ts +0 -4
- package/dist/models/CommandValidations.js +0 -183
- package/dist/models/InhibitorValidations.d.ts +0 -12
- package/dist/models/InhibitorValidations.js +0 -42
- package/dist/types/enums.d.ts +0 -35
|
@@ -1,32 +1,61 @@
|
|
|
1
|
-
import { TextChannel, Message, User, Guild, GuildMember, Channel, Role, InteractionResponse } from 'discord.js';
|
|
2
|
-
import { InteractionCommandUtil, MessageCommandUtil } from '../utils/CommandUtil.js';
|
|
3
|
-
export interface XernerxMessage extends Message {
|
|
4
|
-
util?: MessageCommandUtil;
|
|
5
|
-
response?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface XernerxInteraction extends InteractionResponse {
|
|
8
|
-
util: InteractionCommandUtil;
|
|
9
|
-
options?: {
|
|
10
|
-
_group: string;
|
|
11
|
-
_subcommand: string;
|
|
12
|
-
_hoistedOptions: Array<{
|
|
13
|
-
name: string;
|
|
14
|
-
channel: Channel;
|
|
15
|
-
user: XernerxUser;
|
|
16
|
-
role: XernerxRole;
|
|
17
|
-
value: string;
|
|
18
|
-
}>;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export interface XernerxUser extends User {
|
|
22
|
-
isOwner: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface XernerxRole extends Role {
|
|
25
|
-
}
|
|
26
|
-
export interface
|
|
27
|
-
}
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { TextChannel, Message, User, Guild, GuildMember, Channel, Role, InteractionResponse } from 'discord.js';
|
|
2
|
+
import { InteractionCommandUtil, MessageCommandUtil } from '../utils/CommandUtil.js';
|
|
3
|
+
export interface XernerxMessage extends Message {
|
|
4
|
+
util?: MessageCommandUtil;
|
|
5
|
+
response?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface XernerxInteraction extends InteractionResponse {
|
|
8
|
+
util: InteractionCommandUtil;
|
|
9
|
+
options?: {
|
|
10
|
+
_group: string;
|
|
11
|
+
_subcommand: string;
|
|
12
|
+
_hoistedOptions: Array<{
|
|
13
|
+
name: string;
|
|
14
|
+
channel: Channel;
|
|
15
|
+
user: XernerxUser;
|
|
16
|
+
role: XernerxRole;
|
|
17
|
+
value: string;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface XernerxUser extends User {
|
|
22
|
+
isOwner: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface XernerxRole extends Role {}
|
|
25
|
+
export interface XernerxTextChannel extends TextChannel {}
|
|
26
|
+
export interface XernerxGuild extends Guild {}
|
|
27
|
+
export interface XernerxMember extends GuildMember {}
|
|
28
|
+
export type MessageCommandArgsTypes = 'rest' | 'option' | 'flag' | 'string' | 'number' | 'channel' | 'user' | 'member' | 'boolean' | 'role';
|
|
29
|
+
export type Localizations =
|
|
30
|
+
| 'id'
|
|
31
|
+
| 'da'
|
|
32
|
+
| 'de'
|
|
33
|
+
| 'en-GB'
|
|
34
|
+
| 'en-US'
|
|
35
|
+
| 'es-ES'
|
|
36
|
+
| 'fr'
|
|
37
|
+
| 'hr'
|
|
38
|
+
| 'it'
|
|
39
|
+
| 'lt'
|
|
40
|
+
| 'hu'
|
|
41
|
+
| 'nl'
|
|
42
|
+
| 'no'
|
|
43
|
+
| 'pl'
|
|
44
|
+
| 'pt-BR'
|
|
45
|
+
| 'ro'
|
|
46
|
+
| 'fi'
|
|
47
|
+
| 'sv-SE'
|
|
48
|
+
| 'vi'
|
|
49
|
+
| 'tr'
|
|
50
|
+
| 'cs'
|
|
51
|
+
| 'el'
|
|
52
|
+
| 'bg'
|
|
53
|
+
| 'ru'
|
|
54
|
+
| 'uk'
|
|
55
|
+
| 'hi'
|
|
56
|
+
| 'th'
|
|
57
|
+
| 'zh-CN'
|
|
58
|
+
| 'ja'
|
|
59
|
+
| 'zh-TW'
|
|
60
|
+
| 'ko';
|
|
61
|
+
export type EventEmitterType = 'client' | 'process';
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { ActivityType, ClientPresenceStatus } from 'discord.js';
|
|
2
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
-
interface Presence {
|
|
4
|
-
text?: string;
|
|
5
|
-
type?: ActivityType.Playing | ActivityType.Streaming | ActivityType.Listening | ActivityType.Watching | ActivityType.Competing;
|
|
6
|
-
link?: string;
|
|
7
|
-
status?: ClientPresenceStatus;
|
|
8
|
-
interval?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare class ClientUtil {
|
|
11
|
-
client: XernerxClient;
|
|
12
|
-
constructor(client: XernerxClient);
|
|
13
|
-
uptime(timestamp: number | null): string;
|
|
14
|
-
getSubcommands(name: string): object[];
|
|
15
|
-
isOwner(userId: string): boolean;
|
|
16
|
-
getAllCommands(): object[];
|
|
17
|
-
getAllMessageCommands(): object[];
|
|
18
|
-
getAllSlashCommands(): object[];
|
|
19
|
-
getAllContextCommands(): object[];
|
|
20
|
-
setPresence(options: Presence): void;
|
|
21
|
-
getCooldowns(id: string, command?: string): any;
|
|
22
|
-
getCooldownTimers(id: string, command?: string): any;
|
|
23
|
-
defer(time: number): Promise<unknown>;
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
1
|
+
import { ActivityType, ClientPresenceStatus } from 'discord.js';
|
|
2
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
+
interface Presence {
|
|
4
|
+
text?: string;
|
|
5
|
+
type?: ActivityType.Playing | ActivityType.Streaming | ActivityType.Listening | ActivityType.Watching | ActivityType.Competing;
|
|
6
|
+
link?: string;
|
|
7
|
+
status?: ClientPresenceStatus;
|
|
8
|
+
interval?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class ClientUtil {
|
|
11
|
+
client: XernerxClient;
|
|
12
|
+
constructor(client: XernerxClient);
|
|
13
|
+
uptime(timestamp: number | null): string;
|
|
14
|
+
getSubcommands(name: string): object[];
|
|
15
|
+
isOwner(userId: string): boolean;
|
|
16
|
+
getAllCommands(): object[];
|
|
17
|
+
getAllMessageCommands(): object[];
|
|
18
|
+
getAllSlashCommands(): object[];
|
|
19
|
+
getAllContextCommands(): object[];
|
|
20
|
+
setPresence(options: Presence): void;
|
|
21
|
+
getCooldowns(id: string, command?: string): any;
|
|
22
|
+
getCooldownTimers(id: string, command?: string): any;
|
|
23
|
+
defer(time: number): Promise<unknown>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -1,56 +1,58 @@
|
|
|
1
|
-
import { ActionRowBuilder, ButtonBuilder, EmbedBuilder, Interaction, Message, MessagePayload, StringSelectMenuBuilder } from 'discord.js';
|
|
2
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
-
import { XernerxMessage } from '../types/types.js';
|
|
4
|
-
interface SelectMenuOptions {
|
|
5
|
-
index?: EmbedBuilder;
|
|
6
|
-
row?: ActionRowBuilder;
|
|
7
|
-
component?: StringSelectMenuBuilder;
|
|
8
|
-
components?: object[];
|
|
9
|
-
reply?: boolean;
|
|
10
|
-
id?: string;
|
|
11
|
-
filter?: Function;
|
|
12
|
-
time?: number;
|
|
13
|
-
ephemeral?: boolean;
|
|
14
|
-
}
|
|
15
|
-
interface ButtonOptions {
|
|
16
|
-
index?: number;
|
|
17
|
-
buttons?: Array<string>;
|
|
18
|
-
reply?: boolean;
|
|
19
|
-
row?: ActionRowBuilder;
|
|
20
|
-
component?: ButtonBuilder;
|
|
21
|
-
components?: object[];
|
|
22
|
-
id?: string;
|
|
23
|
-
filter?: any;
|
|
24
|
-
time?: number;
|
|
25
|
-
ephemeral?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export declare class MessageCommandUtil {
|
|
28
|
-
client: XernerxClient;
|
|
29
|
-
message: XernerxMessage;
|
|
30
|
-
constructor(client: XernerxClient, message: Message & XernerxMessage);
|
|
31
|
-
reply(content: MessagePayload | string): Promise<Message<boolean> | undefined>;
|
|
32
|
-
send(content: MessagePayload | string): Promise<Message<true> | Message<false> | undefined>;
|
|
33
|
-
defer(time: number): Promise<unknown>;
|
|
34
|
-
getCommands(): import(
|
|
35
|
-
getCommandName(): void;
|
|
36
|
-
selectMenuPaginator(embeds: Array<EmbedBuilder>, options?: SelectMenuOptions): void;
|
|
37
|
-
buttonPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions): void;
|
|
38
|
-
buttonMenuPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions & SelectMenuOptions): void;
|
|
39
|
-
isOwner(): boolean;
|
|
40
|
-
createModal(): void;
|
|
41
|
-
}
|
|
42
|
-
export declare class InteractionCommandUtil {
|
|
43
|
-
client: XernerxClient;
|
|
44
|
-
interaction: any;
|
|
45
|
-
constructor(client: XernerxClient, interaction: Interaction);
|
|
46
|
-
reply(content: MessagePayload | string): any;
|
|
47
|
-
defer(time: number): Promise<unknown>;
|
|
48
|
-
getCommands():
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
import { ActionRowBuilder, ButtonBuilder, EmbedBuilder, Interaction, Message, MessagePayload, StringSelectMenuBuilder } from 'discord.js';
|
|
2
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
+
import { XernerxMessage } from '../types/types.js';
|
|
4
|
+
interface SelectMenuOptions {
|
|
5
|
+
index?: EmbedBuilder;
|
|
6
|
+
row?: ActionRowBuilder;
|
|
7
|
+
component?: StringSelectMenuBuilder;
|
|
8
|
+
components?: object[];
|
|
9
|
+
reply?: boolean;
|
|
10
|
+
id?: string;
|
|
11
|
+
filter?: Function;
|
|
12
|
+
time?: number;
|
|
13
|
+
ephemeral?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface ButtonOptions {
|
|
16
|
+
index?: number;
|
|
17
|
+
buttons?: Array<string>;
|
|
18
|
+
reply?: boolean;
|
|
19
|
+
row?: ActionRowBuilder;
|
|
20
|
+
component?: ButtonBuilder;
|
|
21
|
+
components?: object[];
|
|
22
|
+
id?: string;
|
|
23
|
+
filter?: any;
|
|
24
|
+
time?: number;
|
|
25
|
+
ephemeral?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare class MessageCommandUtil {
|
|
28
|
+
client: XernerxClient;
|
|
29
|
+
message: XernerxMessage;
|
|
30
|
+
constructor(client: XernerxClient, message: Message & XernerxMessage);
|
|
31
|
+
reply(content: MessagePayload | string): Promise<Message<boolean> | undefined>;
|
|
32
|
+
send(content: MessagePayload | string): Promise<Message<true> | Message<false> | undefined>;
|
|
33
|
+
defer(time: number): Promise<unknown>;
|
|
34
|
+
getCommands(): import('@discordjs/collection').Collection<string, import('../main.js').MessageCommandBuilder>;
|
|
35
|
+
getCommandName(): void;
|
|
36
|
+
selectMenuPaginator(embeds: Array<EmbedBuilder>, options?: SelectMenuOptions): void;
|
|
37
|
+
buttonPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions): void;
|
|
38
|
+
buttonMenuPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions & SelectMenuOptions): void;
|
|
39
|
+
isOwner(): boolean;
|
|
40
|
+
createModal(): void;
|
|
41
|
+
}
|
|
42
|
+
export declare class InteractionCommandUtil {
|
|
43
|
+
client: XernerxClient;
|
|
44
|
+
interaction: any;
|
|
45
|
+
constructor(client: XernerxClient, interaction: Interaction);
|
|
46
|
+
reply(content: MessagePayload | string): any;
|
|
47
|
+
defer(time: number): Promise<unknown>;
|
|
48
|
+
getCommands():
|
|
49
|
+
| import('@discordjs/collection').Collection<string, import('../main.js').SlashCommandBuilder>
|
|
50
|
+
| import('@discordjs/collection').Collection<string, import('../main.js').ContextCommandBuilder>;
|
|
51
|
+
getCommandName(): void;
|
|
52
|
+
selectMenuPaginator(embeds: Array<EmbedBuilder>, options?: SelectMenuOptions): void;
|
|
53
|
+
buttonPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions): void;
|
|
54
|
+
buttonMenuPaginator(embeds: Array<EmbedBuilder>, options: ButtonOptions & SelectMenuOptions): void;
|
|
55
|
+
isOwner(): boolean;
|
|
56
|
+
createModal(): void;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { Interaction } from 'discord.js';
|
|
2
|
-
import ContextCommandBuilder from '../build/ContextCommandBuilder.js';
|
|
3
|
-
import MessageCommandBuilder from '../build/MessageCommandBuilder.js';
|
|
4
|
-
import SlashCommandBuilder from '../build/SlashCommandBuilder.js';
|
|
5
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
6
|
-
import { XernerxMessage } from '../types/types.js';
|
|
7
|
-
export default function commandValidation(
|
|
1
|
+
import { Interaction } from 'discord.js';
|
|
2
|
+
import ContextCommandBuilder from '../build/ContextCommandBuilder.js';
|
|
3
|
+
import MessageCommandBuilder from '../build/MessageCommandBuilder.js';
|
|
4
|
+
import SlashCommandBuilder from '../build/SlashCommandBuilder.js';
|
|
5
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
6
|
+
import { XernerxMessage } from '../types/types.js';
|
|
7
|
+
export default function commandValidation(
|
|
8
|
+
action: XernerxMessage | Interaction,
|
|
9
|
+
command: SlashCommandBuilder | MessageCommandBuilder | ContextCommandBuilder | any,
|
|
10
|
+
client: XernerxClient,
|
|
11
|
+
res?: boolean
|
|
12
|
+
): boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import { XernerxInteraction, XernerxMessage } from '../types/types.js';
|
|
3
|
-
export declare class InhibitorValidation {
|
|
4
|
-
client: XernerxClient;
|
|
5
|
-
action: XernerxMessage | XernerxInteraction;
|
|
6
|
-
command: string;
|
|
7
|
-
inhibited: Record<string, string | void>;
|
|
8
|
-
constructor(client: XernerxClient, action: XernerxMessage | XernerxInteraction, command: string);
|
|
9
|
-
inhibit(): Promise<Record<string, string | void> | undefined>;
|
|
10
|
-
private args;
|
|
11
|
-
}
|
|
1
|
+
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
+
import { XernerxInteraction, XernerxMessage } from '../types/types.js';
|
|
3
|
+
export declare class InhibitorValidation {
|
|
4
|
+
client: XernerxClient;
|
|
5
|
+
action: XernerxMessage | XernerxInteraction;
|
|
6
|
+
command: string;
|
|
7
|
+
inhibited: Record<string, string | void>;
|
|
8
|
+
constructor(client: XernerxClient, action: XernerxMessage | XernerxInteraction, command: string);
|
|
9
|
+
inhibit(): Promise<Record<string, string | void> | undefined>;
|
|
10
|
+
private args;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ChannelType, ContextMenuCommandBuilder, Interaction } from 'discord.js';
|
|
2
|
-
import { ContextCommandOptions } from '../types/options.js';
|
|
3
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
-
/**
|
|
5
|
-
* @description The command builder for context commands.
|
|
6
|
-
* @param {String} id - The unique ID of the command.
|
|
7
|
-
* @param {ContextCommandOptions} options - The command options.
|
|
8
|
-
*/
|
|
9
|
-
export default class ContextCommandBuilder {
|
|
10
|
-
id: string;
|
|
11
|
-
data: ContextMenuCommandBuilder;
|
|
12
|
-
name: string;
|
|
13
|
-
type: number;
|
|
14
|
-
description?: string;
|
|
15
|
-
info?: string;
|
|
16
|
-
category?: string;
|
|
17
|
-
owner?: boolean;
|
|
18
|
-
channelType?: ChannelType | ChannelType[];
|
|
19
|
-
cooldown?: number;
|
|
20
|
-
ignoreOwner?: boolean;
|
|
21
|
-
channels?: string[];
|
|
22
|
-
guilds?: string[];
|
|
23
|
-
userPermissions?: bigint[];
|
|
24
|
-
clientPermissions?: bigint[];
|
|
25
|
-
defer?: {
|
|
26
|
-
reply?: boolean;
|
|
27
|
-
ephemeral?: boolean;
|
|
28
|
-
fetchReply?: boolean;
|
|
29
|
-
};
|
|
30
|
-
client: XernerxClient | object;
|
|
31
|
-
constructor(id: string, options: ContextCommandOptions);
|
|
32
|
-
/**
|
|
33
|
-
* @param {Interaction} interaction - The Discord interaction event data.
|
|
34
|
-
* @description make any preconditions here.
|
|
35
|
-
*/
|
|
36
|
-
conditions(interaction: Interaction): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* @param {Interaction} interaction - The Discord interaction event data.
|
|
39
|
-
* @description Make your custom command here.
|
|
40
|
-
*/
|
|
41
|
-
exec(interaction: Interaction): Promise<void>;
|
|
42
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Message, ChannelType } from 'discord.js';
|
|
2
|
-
import { MessageArgOptions, MessageCommandOptions } from '../types/options.js';
|
|
3
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
-
/**
|
|
5
|
-
* @description - The command builder for message commands.
|
|
6
|
-
* @param {String} id - The unique ID of the command.
|
|
7
|
-
* @param {MessageCommandOptions} options - The command options.
|
|
8
|
-
*/
|
|
9
|
-
export default class MessageCommandBuilder {
|
|
10
|
-
id: string;
|
|
11
|
-
name: string;
|
|
12
|
-
aliases?: string[];
|
|
13
|
-
description?: string;
|
|
14
|
-
info?: string;
|
|
15
|
-
category?: string;
|
|
16
|
-
prefix?: string | string[];
|
|
17
|
-
regex?: string;
|
|
18
|
-
owner?: boolean;
|
|
19
|
-
channelType?: ChannelType | ChannelType[];
|
|
20
|
-
separator?: string;
|
|
21
|
-
cooldown?: number;
|
|
22
|
-
ignoreOwner?: boolean;
|
|
23
|
-
channels?: string[];
|
|
24
|
-
guilds?: string[];
|
|
25
|
-
userPermissions?: bigint[];
|
|
26
|
-
clientPermissions?: bigint[];
|
|
27
|
-
args?: Array<MessageArgOptions>;
|
|
28
|
-
client: XernerxClient | object;
|
|
29
|
-
constructor(id: string, options: MessageCommandOptions);
|
|
30
|
-
/**
|
|
31
|
-
* @param {Message} message - The Discord message event data.
|
|
32
|
-
* @param {object} args - The arguments you created.
|
|
33
|
-
* @description make any preconditions here.
|
|
34
|
-
*/
|
|
35
|
-
conditions(message: Message, args: MessageArgOptions): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* @param {Message} message - The Discord message event data.
|
|
38
|
-
* @param {object} args - The arguments you created.
|
|
39
|
-
* @description Make your custom command here.
|
|
40
|
-
*/
|
|
41
|
-
exec(message: Message, args: MessageArgOptions): Promise<void>;
|
|
42
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import Discord, { ChannelType, Interaction } from 'discord.js';
|
|
2
|
-
import { SlashCommandOptions } from '../types/options.js';
|
|
3
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
-
/**
|
|
5
|
-
* @description - The command builder for slash commands.
|
|
6
|
-
* @param {String} id - The unique ID of the command.
|
|
7
|
-
* @param {SlashCommandOptions} options - The command options.
|
|
8
|
-
*/
|
|
9
|
-
export default class SlashCommandBuilder {
|
|
10
|
-
id: string;
|
|
11
|
-
data: Discord.SlashCommandBuilder;
|
|
12
|
-
name: string;
|
|
13
|
-
description: string;
|
|
14
|
-
info?: string;
|
|
15
|
-
category?: string;
|
|
16
|
-
owner?: boolean;
|
|
17
|
-
channelType?: ChannelType | ChannelType[];
|
|
18
|
-
separator?: string;
|
|
19
|
-
cooldown?: number;
|
|
20
|
-
ignoreOwner?: boolean;
|
|
21
|
-
channels?: string[];
|
|
22
|
-
guilds?: string[];
|
|
23
|
-
userPermissions?: bigint[];
|
|
24
|
-
clientPermissions?: bigint[];
|
|
25
|
-
args?: object[];
|
|
26
|
-
subcommands?: object[];
|
|
27
|
-
groups?: object[];
|
|
28
|
-
defer?: {
|
|
29
|
-
reply?: boolean;
|
|
30
|
-
ephemeral?: boolean;
|
|
31
|
-
fetchReply?: boolean;
|
|
32
|
-
};
|
|
33
|
-
client: XernerxClient | object;
|
|
34
|
-
constructor(id: string, options: SlashCommandOptions);
|
|
35
|
-
conditions(interaction: Interaction): Promise<void>;
|
|
36
|
-
exec(interaction: Interaction): Promise<void>;
|
|
37
|
-
private addArgs;
|
|
38
|
-
private addSubcommands;
|
|
39
|
-
private addSubcommandGroups;
|
|
40
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ChannelType, ContextMenuCommandBuilder, Interaction } from 'discord.js';
|
|
2
|
-
import { ContextCommandOptions } from '../types/options.js';
|
|
3
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
-
/**
|
|
5
|
-
* @description The command builder for context commands.
|
|
6
|
-
* @param {String} id - The unique ID of the command.
|
|
7
|
-
* @param {ContextCommandOptions} options - The command options.
|
|
8
|
-
*/
|
|
9
|
-
export default class XContextCommandBuilder {
|
|
10
|
-
id: string;
|
|
11
|
-
data: ContextMenuCommandBuilder;
|
|
12
|
-
description?: string;
|
|
13
|
-
info?: string;
|
|
14
|
-
category?: string;
|
|
15
|
-
owner?: boolean;
|
|
16
|
-
channelType?: ChannelType | ChannelType[];
|
|
17
|
-
cooldown?: number;
|
|
18
|
-
ignoreOwner?: boolean;
|
|
19
|
-
channels?: string[];
|
|
20
|
-
guilds?: string[];
|
|
21
|
-
userPermissions?: bigint[];
|
|
22
|
-
clientPermissions?: bigint[];
|
|
23
|
-
defer?: {
|
|
24
|
-
reply?: boolean;
|
|
25
|
-
ephemeral?: boolean;
|
|
26
|
-
fetchReply?: boolean;
|
|
27
|
-
};
|
|
28
|
-
client: XernerxClient | object;
|
|
29
|
-
constructor(id: string, options: ContextCommandOptions);
|
|
30
|
-
/**
|
|
31
|
-
* @param {Interaction} interaction - The Discord interaction event data.
|
|
32
|
-
* @description make any preconditions here.
|
|
33
|
-
*/
|
|
34
|
-
conditions(interaction: Interaction): Promise<void>;
|
|
35
|
-
/**
|
|
36
|
-
* @param {Interaction} interaction - The Discord interaction event data.
|
|
37
|
-
* @description Make your custom command here.
|
|
38
|
-
*/
|
|
39
|
-
exec(interaction: Interaction): Promise<void>;
|
|
40
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { ContextMenuCommandBuilder } from 'discord.js';
|
|
2
|
-
import { s } from '@sapphire/shapeshift';
|
|
3
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
4
|
-
/**
|
|
5
|
-
* @description The command builder for context commands.
|
|
6
|
-
* @param {String} id - The unique ID of the command.
|
|
7
|
-
* @param {ContextCommandOptions} options - The command options.
|
|
8
|
-
*/
|
|
9
|
-
export default class XContextCommandBuilder {
|
|
10
|
-
id;
|
|
11
|
-
data;
|
|
12
|
-
description;
|
|
13
|
-
info;
|
|
14
|
-
category;
|
|
15
|
-
owner;
|
|
16
|
-
channelType;
|
|
17
|
-
cooldown;
|
|
18
|
-
ignoreOwner;
|
|
19
|
-
channels;
|
|
20
|
-
guilds;
|
|
21
|
-
userPermissions;
|
|
22
|
-
clientPermissions;
|
|
23
|
-
defer;
|
|
24
|
-
client;
|
|
25
|
-
constructor(id, options) {
|
|
26
|
-
this.id = id;
|
|
27
|
-
this.data = new ContextMenuCommandBuilder();
|
|
28
|
-
if (options.name)
|
|
29
|
-
this.data.setName(options.name);
|
|
30
|
-
if (options.type)
|
|
31
|
-
this.data.setType(options.type);
|
|
32
|
-
if (options.defaultMemberPermissions)
|
|
33
|
-
this.data.setDefaultMemberPermissions(options.defaultMemberPermissions);
|
|
34
|
-
if (options.DMPermission)
|
|
35
|
-
this.data.setDMPermission(options.DMPermission);
|
|
36
|
-
if (options.nameLocalization)
|
|
37
|
-
this.data.setNameLocalization(options.nameLocalization.locale, options.nameLocalization.localizedName);
|
|
38
|
-
if (options.nameLocalizations)
|
|
39
|
-
this.data.setNameLocalizations(options.nameLocalizations);
|
|
40
|
-
s.object({
|
|
41
|
-
description: s.string.optional,
|
|
42
|
-
info: s.string.optional,
|
|
43
|
-
category: s.string.optional,
|
|
44
|
-
owner: s.boolean.optional,
|
|
45
|
-
channelType: s.union(s.number, s.array(s.number)).optional,
|
|
46
|
-
cooldown: s.number.optional,
|
|
47
|
-
ignoreOwner: s.boolean.optional,
|
|
48
|
-
channels: s.array(s.string).optional,
|
|
49
|
-
guilds: s.array(s.string).optional,
|
|
50
|
-
userPermissions: s.array(s.bigint).optional,
|
|
51
|
-
clientPermissions: s.array(s.bigint).optional,
|
|
52
|
-
defer: s.object({
|
|
53
|
-
reply: s.boolean.optional,
|
|
54
|
-
ephemeral: s.boolean.optional,
|
|
55
|
-
fetchReply: s.boolean.optional,
|
|
56
|
-
}).optional,
|
|
57
|
-
}).parse(options);
|
|
58
|
-
this.description = options.description;
|
|
59
|
-
this.info = options.info;
|
|
60
|
-
this.category = options.category;
|
|
61
|
-
this.owner = options.owner;
|
|
62
|
-
this.channelType = options.channelType;
|
|
63
|
-
this.cooldown = options.cooldown;
|
|
64
|
-
this.ignoreOwner = options.ignoreOwner;
|
|
65
|
-
this.channels = options.channels;
|
|
66
|
-
this.guilds = options.guilds;
|
|
67
|
-
this.userPermissions = options.userPermissions;
|
|
68
|
-
this.clientPermissions = options.clientPermissions;
|
|
69
|
-
this.defer = options.defer;
|
|
70
|
-
this.client = XernerxClient;
|
|
71
|
-
this.conditions = this.conditions;
|
|
72
|
-
this.exec = this.exec;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* @param {Interaction} interaction - The Discord interaction event data.
|
|
76
|
-
* @description make any preconditions here.
|
|
77
|
-
*/
|
|
78
|
-
async conditions(interaction) { }
|
|
79
|
-
/**
|
|
80
|
-
* @param {Interaction} interaction - The Discord interaction event data.
|
|
81
|
-
* @description Make your custom command here.
|
|
82
|
-
*/
|
|
83
|
-
async exec(interaction) { }
|
|
84
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import { EventOptions } from '../types/options.js';
|
|
3
|
-
/**
|
|
4
|
-
* @description - The event builder for events.
|
|
5
|
-
* @param {String} id - The unique ID of the event.
|
|
6
|
-
* @param {EventOptions} options - The event options.
|
|
7
|
-
*/
|
|
8
|
-
export default class XEventBuilder {
|
|
9
|
-
id: string;
|
|
10
|
-
name: string;
|
|
11
|
-
emitter?: string;
|
|
12
|
-
type?: string;
|
|
13
|
-
once?: boolean;
|
|
14
|
-
client: XernerxClient | object;
|
|
15
|
-
constructor(id: string, options: EventOptions);
|
|
16
|
-
run(): Promise<void>;
|
|
17
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { s } from '@sapphire/shapeshift';
|
|
2
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
-
/**
|
|
4
|
-
* @description - The event builder for events.
|
|
5
|
-
* @param {String} id - The unique ID of the event.
|
|
6
|
-
* @param {EventOptions} options - The event options.
|
|
7
|
-
*/
|
|
8
|
-
export default class XEventBuilder {
|
|
9
|
-
id;
|
|
10
|
-
name;
|
|
11
|
-
emitter;
|
|
12
|
-
type;
|
|
13
|
-
once;
|
|
14
|
-
client;
|
|
15
|
-
constructor(id, options) {
|
|
16
|
-
this.id = id;
|
|
17
|
-
s.object({
|
|
18
|
-
name: s.string,
|
|
19
|
-
emitter: s.string.optional,
|
|
20
|
-
type: s.string.optional,
|
|
21
|
-
once: s.boolean.optional,
|
|
22
|
-
}).parse(options);
|
|
23
|
-
this.name = options.name;
|
|
24
|
-
this.emitter = options.emitter || 'client';
|
|
25
|
-
this.type = options.type || 'discord';
|
|
26
|
-
this.once = options.once || false;
|
|
27
|
-
this.client = XernerxClient;
|
|
28
|
-
this.run = this.run;
|
|
29
|
-
}
|
|
30
|
-
async run() {
|
|
31
|
-
/**
|
|
32
|
-
* @description run your custom event here.
|
|
33
|
-
*/
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
2
|
-
import { InhibitorType } from '../main.js';
|
|
3
|
-
import { InhibitorOptions, MessageArgOptions, SlashArgOptions } from '../types/options.js';
|
|
4
|
-
import { XernerxInteraction, XernerxMessage } from '../types/types.js';
|
|
5
|
-
/**
|
|
6
|
-
* @description - The inhibitor builder for inhibitors.
|
|
7
|
-
* @param {String} id - The unique ID of the inhibitor.
|
|
8
|
-
* @param {InhibitorOptions} options - The inhibitor options.
|
|
9
|
-
*/
|
|
10
|
-
export default class XInhibitorBuilder {
|
|
11
|
-
id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
type: InhibitorType;
|
|
14
|
-
client: XernerxClient | object;
|
|
15
|
-
constructor(id: string, options: InhibitorOptions);
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
check(interaction: XernerxInteraction | XernerxMessage, args: SlashArgOptions | MessageArgOptions): Promise<void>;
|
|
20
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { s } from '@sapphire/shapeshift';
|
|
2
|
-
import XernerxClient from '../client/XernerxClient.js';
|
|
3
|
-
/**
|
|
4
|
-
* @description - The inhibitor builder for inhibitors.
|
|
5
|
-
* @param {String} id - The unique ID of the inhibitor.
|
|
6
|
-
* @param {InhibitorOptions} options - The inhibitor options.
|
|
7
|
-
*/
|
|
8
|
-
export default class XInhibitorBuilder {
|
|
9
|
-
id;
|
|
10
|
-
name;
|
|
11
|
-
type;
|
|
12
|
-
client;
|
|
13
|
-
constructor(id, options) {
|
|
14
|
-
this.id = id;
|
|
15
|
-
s.object({
|
|
16
|
-
name: s.string,
|
|
17
|
-
type: s.string,
|
|
18
|
-
}).parse(options);
|
|
19
|
-
this.name = options.name;
|
|
20
|
-
this.type = options.type;
|
|
21
|
-
this.client = XernerxClient;
|
|
22
|
-
this.check = this.check;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
async check(interaction, args) { }
|
|
28
|
-
}
|