xernerx 4.4.8 → 4.4.9

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.
@@ -1,5 +1,6 @@
1
1
  import { ContextMenuCommandBuilder } from 'discord.js';
2
2
  import XernerxClient from '../client/XernerxClient.js';
3
+ import { XernerxMessage, XernerxMessageContextInteraction, XernerxUser, XernerxUserContextInteraction } from '../types/extenders.js';
3
4
  import { ContextCommandOptions } from '../types/interfaces.js';
4
5
  export default class ContextCommandBuilder {
5
6
  readonly id: string;
@@ -37,5 +38,5 @@ export default class ContextCommandBuilder {
37
38
  readonly filePath: string;
38
39
  readonly client: typeof XernerxClient;
39
40
  constructor(id: string, options: ContextCommandOptions);
40
- exec(): Promise<void>;
41
+ exec<T>(interaction: XernerxUserContextInteraction | XernerxMessageContextInteraction, args: XernerxUser | XernerxMessage): Promise<void | T | undefined>;
41
42
  }
@@ -63,5 +63,5 @@ export default class ContextCommandBuilder {
63
63
  this.defer = options.defer;
64
64
  this.client = XernerxClient;
65
65
  }
66
- async exec() { }
66
+ async exec(interaction, args) { }
67
67
  }
@@ -20,5 +20,5 @@ export default class EventBuilder {
20
20
  * @description run your custom event here.
21
21
  * TODO - update description
22
22
  */
23
- run(): Promise<void>;
23
+ run<T>(...args: Array<T>): Promise<void | undefined | T>;
24
24
  }
@@ -25,5 +25,5 @@ export default class EventBuilder {
25
25
  * @description run your custom event here.
26
26
  * TODO - update description
27
27
  */
28
- async run() { }
28
+ async run(...args) { }
29
29
  }
@@ -15,5 +15,5 @@ export default class InhibitorBuilder {
15
15
  readonly filePath: string;
16
16
  readonly client: typeof XernerxClient;
17
17
  constructor(id: string, options: InhibitorBuilderOptions);
18
- check(interaction: XernerxMessage | XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction, args: any): Promise<void>;
18
+ check<T>(interaction: XernerxMessage | XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction, args: T): Promise<void | undefined | T>;
19
19
  }
@@ -36,6 +36,6 @@ export default class MessageCommandBuilder {
36
36
  readonly filePath: string;
37
37
  readonly client: typeof XernerxClient;
38
38
  constructor(id: string, options: MessageCommandOptions);
39
- conditions(message: XernerxMessage, { args, flags }: any): Promise<void>;
40
- exec(message: XernerxMessage, { args, flags }: any): Promise<void>;
39
+ conditions<T>(message: XernerxMessage, { args, flags }: any): Promise<void | undefined | T>;
40
+ exec<T>(message: XernerxMessage, { args, flags }: any): Promise<void | undefined | T>;
41
41
  }
@@ -38,9 +38,9 @@ export default class SlashCommandBuilder {
38
38
  readonly filePath: string;
39
39
  readonly client: typeof XernerxClient;
40
40
  constructor(id: string, options: SlashCommandOptions);
41
- autocomplete<T>(interaction: XernerxInteraction, focused: T, options: T[]): Promise<void>;
42
- conditions(interaction: XernerxSlashInteraction, { args, subcommand, group }: any): Promise<void>;
43
- exec(interaction: XernerxSlashInteraction, { args, subcommand, group }: any): Promise<void>;
41
+ autocomplete<T>(interaction: XernerxInteraction, focused: T, options: T[]): Promise<void | undefined | T>;
42
+ conditions<T>(interaction: XernerxSlashInteraction, { args, subcommand, group }: any): Promise<void | undefined | T>;
43
+ exec<T>(interaction: XernerxSlashInteraction, { args, subcommand, group }: any): Promise<void | undefined | T>;
44
44
  private addArguments;
45
45
  private addSubcommands;
46
46
  private addSubcommandGroups;
@@ -7,7 +7,7 @@ export type SlashCommandOptionChoices = SlashCommandStringOption | SlashCommandN
7
7
  export type SlashCommandOption = SlashCommandOptionChoices | SlashCommandBooleanOption | SlashCommandUserOption | SlashCommandChannelOption | SlashCommandRoleOption | SlashCommandMentionableOption;
8
8
  export type MessageCommandArgumentType = 'string' | 'number' | 'boolean' | 'confirm' | 'channel' | 'guild' | 'integer' | 'mentionable' | 'role' | 'user' | 'message' | 'member' | 'list' | 'option' | 'rest';
9
9
  export type DiscordEventType = 'applicationCommandPermissionsUpdate' | 'autoModerationActionExecution' | 'autoModerationRuleCreate' | 'autoModerationRuleDelete' | 'autoModerationRuleUpdate' | 'ready' | 'guildCreate' | 'guildDelete' | 'guildUpdate' | 'guildUnavailable' | 'guildMemberAdd' | 'guildMemberRemove' | 'guildMemberUpdate' | 'guildMemberAvailable' | 'guildMembersChunk' | 'guildIntegrationsUpdate' | 'roleCreate' | 'roleDelete' | 'inviteCreate' | 'inviteDelete' | 'roleUpdate' | 'emojiCreate' | 'emojiDelete' | 'emojiUpdate' | 'guildBanAdd' | 'guildBanRemove' | 'channelCreate' | 'channelDelete' | 'channelUpdate' | 'channelPinsUpdate' | 'messageCreate' | 'messageDelete' | 'messageUpdate' | 'messageDeleteBulk' | 'messageReactionAdd' | 'messageReactionRemove' | 'messageReactionRemoveAll' | 'messageReactionRemoveEmoji' | 'threadCreate' | 'threadDelete' | 'threadUpdate' | 'threadListSync' | 'threadMemberUpdate' | 'threadMembersUpdate' | 'userUpdate' | 'presenceUpdate' | 'voiceServerUpdate' | 'voiceStateUpdate' | 'typingStart' | 'webhookUpdate' | 'interactionCreate' | 'error' | 'warn' | 'debug' | 'cacheSweep' | 'shardDisconnect' | 'shardError' | 'shardReconnecting' | 'shardReady' | 'shardResume' | 'invalidated' | 'raw' | 'stageInstanceCreate' | 'stageInstanceUpdate' | 'stageInstanceDelete' | 'stickerCreate' | 'stickerDelete' | 'stickerUpdate' | 'guildScheduledEventCreate' | 'guildScheduledEventUpdate' | 'guildScheduledEventDelete' | 'guildScheduledEventUserAdd' | 'guildScheduledEventUserRemove';
10
- export type EventType = DiscordEventType | 'webhookInit' | 'webhookPost' | 'webhookError' | 'commandBlock' | 'commandError' | 'commandStart' | 'commandFinish' | 'commandCooldown';
10
+ export type EventType = DiscordEventType | 'webhookCreate' | 'webhookError' | 'commandBlock' | 'commandError' | 'commandStart' | 'commandFinish' | 'commandCooldown';
11
11
  export type XernerxInteraction = XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction;
12
12
  export type PermissionNames = 'create instant invite' | 'kick members' | 'ban members' | 'administrator' | 'manage channels' | 'manage guild' | 'add reactions' | 'view audit log' | 'priority speaker' | 'stream' | 'view channel' | 'send messages' | 'send tts messages' | 'manage messages' | 'embed links' | 'attach files' | 'read message history' | 'mention everyone' | 'use external emojis' | 'view guild insights' | 'connect' | 'speak' | 'mute members' | 'deafen members' | 'move members' | 'use vad' | 'change nickname' | 'manage nicknames' | 'manage roles' | 'manage webhooks' | 'manage emojis and stickers' | 'use application commands' | 'request to speak' | 'manage events' | 'manage threads' | 'create public threads' | 'create private threads' | 'use external stickers' | 'send messages in threads' | 'start embedded activities' | 'moderate members';
13
13
  export type InhibitorType = 'message' | 'interaction' | 'command' | 'channel' | 'user' | 'member' | 'guild' | 'contextCommand' | 'messageCommand' | 'slashCommand';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xernerx",
3
- "version": "4.4.8",
3
+ "version": "4.4.9",
4
4
  "description": "A bot framework for discord.js.",
5
5
  "main": "dist/main.js",
6
6
  "type": "module",