From d96681bfb58052b36923790a90d09a8fd3d699b2 Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Mon, 18 Jul 2022 12:21:23 -0500 Subject: [PATCH] chore: fix predicates.ts, update dependencies, bump version --- package-lock.json | 14 +++++++------- package.json | 4 ++-- src/handler/utilities/predicates.ts | 18 +++++++++++++----- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1e74e79..c4d307f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.1.3-beta", "license": "MIT", "dependencies": { - "discord.js": "^14.0.1", + "discord.js": "^14.0.2", "rxjs": "^7.5.6", "ts-pattern": "^4.0.2", "ts-results": "^3.3.0" @@ -553,9 +553,9 @@ "integrity": "sha512-TunPAvzwneK/m5fr4hxH3bMsrtI22nr9yjfHyo5NBGMjpsAauGNiGCmwoFf0oO3jSd2mZiKUvZwCKDaB166u2Q==" }, "node_modules/discord.js": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.0.1.tgz", - "integrity": "sha512-MZ2cvvk1WCpTUCLcchX5e/mBM22JCPAYle76qEuAfQfVTFdxE2YoKgRWMwWm6s/OJdkXyzglRWj405hg4vikEg==", + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.0.2.tgz", + "integrity": "sha512-aHZHwT4i5yyV4IotFm9lSSPq8mTUkYWTrpatPlT53wz8QyFUPw5XjvUxuOXlaioV1kBsgfhSjCP0BNqxfuSjRQ==", "dependencies": { "@discordjs/builders": "^1.0.0", "@discordjs/collection": "^1.0.0", @@ -2205,9 +2205,9 @@ "integrity": "sha512-TunPAvzwneK/m5fr4hxH3bMsrtI22nr9yjfHyo5NBGMjpsAauGNiGCmwoFf0oO3jSd2mZiKUvZwCKDaB166u2Q==" }, "discord.js": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.0.1.tgz", - "integrity": "sha512-MZ2cvvk1WCpTUCLcchX5e/mBM22JCPAYle76qEuAfQfVTFdxE2YoKgRWMwWm6s/OJdkXyzglRWj405hg4vikEg==", + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.0.2.tgz", + "integrity": "sha512-aHZHwT4i5yyV4IotFm9lSSPq8mTUkYWTrpatPlT53wz8QyFUPw5XjvUxuOXlaioV1kBsgfhSjCP0BNqxfuSjRQ==", "requires": { "@discordjs/builders": "^1.0.0", "@discordjs/collection": "^1.0.0", diff --git a/package.json b/package.json index c9985f0..f6ba610 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sern/handler", - "version": "1.1.3-beta", + "version": "1.1.4-beta", "description": "A customizable, batteries-included, powerful discord.js framework to automate and streamline bot development.", "main": "dist/index.js", "scripts": { @@ -21,7 +21,7 @@ "author": "SernDevs", "license": "MIT", "dependencies": { - "discord.js": "^14.0.1", + "discord.js": "^14.0.2", "rxjs": "^7.5.6", "ts-pattern": "^4.0.2", "ts-results": "^3.3.0" diff --git a/src/handler/utilities/predicates.ts b/src/handler/utilities/predicates.ts index 2ef516d..2a8e157 100644 --- a/src/handler/utilities/predicates.ts +++ b/src/handler/utilities/predicates.ts @@ -3,9 +3,12 @@ import { AutocompleteInteraction, Interaction, InteractionType, - ModalSubmitInteraction, - type CommandInteraction, - type MessageComponentInteraction, + type ModalSubmitInteraction, + type ButtonInteraction, + type SelectMenuInteraction, + type ChatInputCommandInteraction, + type UserContextMenuCommandInteraction, + type MessageContextMenuCommandInteraction, } from 'discord.js'; import type { DiscordEventCommand, @@ -23,7 +26,12 @@ export function correctModuleType( return plug !== undefined && (plug.type & type) !== 0; } -export function isApplicationCommand(interaction: Interaction): interaction is CommandInteraction { +export function isApplicationCommand( + interaction: Interaction, +): interaction is + | ChatInputCommandInteraction + | UserContextMenuCommandInteraction + | MessageContextMenuCommandInteraction { return interaction.type === InteractionType.ApplicationCommand; } @@ -35,7 +43,7 @@ export function isAutocomplete(interaction: Interaction): interaction is Autocom } export function isMessageComponent( interaction: Interaction, -): interaction is MessageComponentInteraction { +): interaction is ButtonInteraction | SelectMenuInteraction { return interaction.type === InteractionType.MessageComponent; }