chore: fix predicates.ts, update dependencies, bump version

This commit is contained in:
Jacob Nguyen
2022-07-18 12:21:23 -05:00
parent d1b034b826
commit d96681bfb5
3 changed files with 22 additions and 14 deletions

14
package-lock.json generated
View File

@@ -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",

View File

@@ -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"

View File

@@ -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<T extends keyof CommandModuleDefs>(
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;
}