Comparing version 11.7.2 to 11.7.3
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Client = void 0; | ||
const tslib_1 = require("tslib"); | ||
const di_1 = require("@discordx/di"); | ||
const discord_js_1 = require("discord.js"); | ||
const escapeRegExp_1 = tslib_1.__importDefault(require("lodash/escapeRegExp")); | ||
const isArray_1 = tslib_1.__importDefault(require("lodash/isArray")); | ||
const lodash_1 = require("lodash"); | ||
const index_js_1 = require("./index.js"); | ||
@@ -780,3 +778,3 @@ /** | ||
if (typeof this.prefix !== "function") { | ||
return (0, isArray_1.default)(this.prefix) ? [...this.prefix] : [this.prefix]; | ||
return (0, lodash_1.isArray)(this.prefix) ? [...this.prefix] : [this.prefix]; | ||
} | ||
@@ -797,3 +795,3 @@ return [...(await this.prefix(message))]; | ||
const prefixRegex = RegExp(`^(${[...prefix, ...mappedPrefix] | ||
.map((pfx) => (0, escapeRegExp_1.default)(pfx)) | ||
.map((pfx) => (0, lodash_1.escapeRegExp)(pfx)) | ||
.join("|")})`); | ||
@@ -800,0 +798,0 @@ const isCommand = prefixRegex.test(message.content); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MetadataStorage = void 0; | ||
const tslib_1 = require("tslib"); | ||
const di_1 = require("@discordx/di"); | ||
const internal_1 = require("@discordx/internal"); | ||
const discord_js_1 = require("discord.js"); | ||
const findIndex_1 = tslib_1.__importDefault(require("lodash/findIndex")); | ||
const lodash_1 = require("lodash"); | ||
const index_js_1 = require("../../index.js"); | ||
@@ -264,3 +263,3 @@ /** | ||
mapCmd.forEach((mapCommand) => { | ||
if ((0, findIndex_1.default)(commands, { name: mapCommand.name }) !== -1) { | ||
if ((0, lodash_1.findIndex)(commands, { name: mapCommand.name }) !== -1) { | ||
throw Error(`Duplicate simple command name: ${mapCommand.name} (of: ${mapCommand.command.name})`); | ||
@@ -274,3 +273,3 @@ } | ||
// To improve search performance, map all commands together | ||
if ((0, findIndex_1.default)(this._simpleCommandsByName, { name: cmd.name }) !== -1) { | ||
if ((0, lodash_1.findIndex)(this._simpleCommandsByName, { name: cmd.name }) !== -1) { | ||
throw Error(`Duplicate simple command name: ${cmd.name}`); | ||
@@ -280,3 +279,3 @@ } | ||
cmd.aliases.forEach((al) => { | ||
if ((0, findIndex_1.default)(this._simpleCommandsByName, { name: al }) !== -1) { | ||
if ((0, lodash_1.findIndex)(this._simpleCommandsByName, { name: al }) !== -1) { | ||
throw Error(`Duplicate simple command name: ${al} (alias of command: ${cmd.name})`); | ||
@@ -283,0 +282,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isApplicationCommandEqual = exports.RecursivelyMatchField = void 0; | ||
const tslib_1 = require("tslib"); | ||
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual")); | ||
const omit_1 = tslib_1.__importDefault(require("lodash/omit")); | ||
const lodash_1 = require("lodash"); | ||
/** | ||
@@ -62,5 +60,5 @@ * Transform bigint to string | ||
} | ||
const firstJson = JSON.parse(jsonToString((0, omit_1.default)(commandJson, "id", "applicationId", "guild", "guildId", "version", "descriptionLocalized", "nameLocalized", "permissions", "defaultPermission"))); | ||
const firstJson = JSON.parse(jsonToString((0, lodash_1.omit)(commandJson, "id", "applicationId", "guild", "guildId", "version", "descriptionLocalized", "nameLocalized", "permissions", "defaultPermission"))); | ||
const secondJson = JSON.parse(jsonToString(rawData)); | ||
const response = (0, isEqual_1.default)(firstJson, secondJson); | ||
const response = (0, lodash_1.isEqual)(firstJson, secondJson); | ||
return response; | ||
@@ -67,0 +65,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.resolveIGuilds = void 0; | ||
const tslib_1 = require("tslib"); | ||
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual")); | ||
const uniqWith_1 = tslib_1.__importDefault(require("lodash/uniqWith")); | ||
const lodash_1 = require("lodash"); | ||
/** | ||
@@ -16,5 +14,5 @@ * Resolve IGuilds | ||
const guildX = await Promise.all(guilds.map((guild) => typeof guild === "function" ? guild(client, command) : guild)); | ||
return (0, uniqWith_1.default)(guildX.flat(1), isEqual_1.default); | ||
return (0, lodash_1.uniqWith)(guildX.flat(1), lodash_1.isEqual); | ||
}; | ||
exports.resolveIGuilds = resolveIGuilds; | ||
//# sourceMappingURL=resolve-guilds.js.map |
import { DIService } from "@discordx/di"; | ||
import { ApplicationCommandOptionType, ApplicationCommandType, Client as ClientJS, InteractionType, } from "discord.js"; | ||
import escapeRegExp from "lodash/escapeRegExp"; | ||
import isArray from "lodash/isArray"; | ||
import { escapeRegExp, isArray } from "lodash"; | ||
import { ApplicationCommandMixin, isApplicationCommandEqual, MetadataStorage, resolveIGuilds, SimpleCommandMessage, SimpleCommandOptionType, SimpleCommandParseType, } from "./index.js"; | ||
@@ -6,0 +5,0 @@ /** |
import { DIService } from "@discordx/di"; | ||
import { Modifier } from "@discordx/internal"; | ||
import { ApplicationCommandOptionType, ApplicationCommandType, } from "discord.js"; | ||
import findIndex from "lodash/findIndex"; | ||
import { findIndex } from "lodash"; | ||
import { ComponentType, DApplicationCommand, DApplicationCommandOption, DComponent, DOn, DReaction, DSimpleCommand, } from "../../index.js"; | ||
@@ -6,0 +6,0 @@ /** |
@@ -1,3 +0,2 @@ | ||
import isEqual from "lodash/isEqual"; | ||
import omit from "lodash/omit"; | ||
import { isEqual, omit } from "lodash"; | ||
/** | ||
@@ -4,0 +3,0 @@ * Transform bigint to string |
@@ -1,3 +0,2 @@ | ||
import isEqual from "lodash/isEqual"; | ||
import uniqWith from "lodash/uniqWith"; | ||
import { isEqual, uniqWith } from "lodash"; | ||
/** | ||
@@ -4,0 +3,0 @@ * Resolve IGuilds |
@@ -5,2 +5,6 @@ ## Changed | ||
## Fixed | ||
- fix [#931](https://github.com/discordx-ts/discordx/issues/931) ([#932](https://github.com/discordx-ts/discordx/issues/932)) ([21ffc6](https://github.com/discordx-ts/discordx/commit/21ffc6d295c1cc3d16e9d4b2d33745a0ebd04427)) | ||
## Routine Tasks | ||
@@ -7,0 +11,0 @@ |
{ | ||
"name": "discordx", | ||
"version": "11.7.2", | ||
"version": "11.7.3", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Create a discord bot with TypeScript and Decorators!", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
605824
10109