Socket
Socket
Sign inDemoInstall

discordx

Package Overview
Dependencies
Maintainers
1
Versions
617
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

discordx - npm Package Compare versions

Comparing version 5.1.8 to 5.1.9

14

build/Client.d.ts

@@ -1,2 +0,2 @@

import { ApplicationCommand, Client as ClientJS, CommandInteraction, Interaction, Message } from "discord.js";
import { ApplicationCommand, Client as ClientJS, CommandInteraction, Interaction, Message, Snowflake } from "discord.js";
import { MetadataStorage, ClientOptions, DiscordEvents, DOn, GuardFunction } from ".";

@@ -17,4 +17,4 @@ import { DButton, DDiscord, DSelectMenu, DSlash } from "./decorators";

private static _guards;
static get slashGuilds(): string[];
static set slashGuilds(value: string[]);
static get slashGuilds(): `${bigint}`[];
static set slashGuilds(value: `${bigint}`[]);
get prefix(): string | ((message: Message) => Promise<string>);

@@ -42,4 +42,4 @@ set prefix(value: string | ((message: Message) => Promise<string>));

set botId(value: string);
get slashGuilds(): string[];
set slashGuilds(value: string[]);
get slashGuilds(): `${bigint}`[];
set slashGuilds(value: `${bigint}`[]);
static get requiredByDefault(): boolean;

@@ -96,3 +96,3 @@ static set requiredByDefault(value: boolean);

*/
fetchSlash(guildID?: string): Promise<import("discord.js").Collection<`${bigint}`, ApplicationCommand<{}>> | undefined>;
fetchSlash(guildID?: Snowflake): Promise<import("discord.js").Collection<`${bigint}`, ApplicationCommand<{}>> | undefined>;
/**

@@ -102,3 +102,3 @@ * Clear the Slash commands globaly or for some guilds

*/
clearSlashes(...guilds: string[]): Promise<void>;
clearSlashes(...guilds: Snowflake[]): Promise<void>;
/**

@@ -105,0 +105,0 @@ * Get the group tree of an interaction

@@ -16,3 +16,3 @@ "use strict";

constructor(options) {
var _a, _b, _c, _d, _e, _f;
var _a, _b, _c, _d, _e, _f, _g;
super(options);

@@ -26,5 +26,5 @@ _1.MetadataStorage.classes = [

this.requiredByDefault = (_c = options.requiredByDefault) !== null && _c !== void 0 ? _c : false;
this.slashGuilds = (_d = options.slashGuilds) !== null && _d !== void 0 ? _d : [];
this._botId = (_e = options.botId) !== null && _e !== void 0 ? _e : "bot";
this._prefix = (_f = options.prefix) !== null && _f !== void 0 ? _f : "!";
this.slashGuilds = (_e = (_d = options.slashGuilds) === null || _d === void 0 ? void 0 : _d.filter((guild) => !!guild)) !== null && _e !== void 0 ? _e : [];
this._botId = (_f = options.botId) !== null && _f !== void 0 ? _f : "bot";
this._prefix = (_g = options.prefix) !== null && _g !== void 0 ? _g : "!";
this._notFoundHandler = options.commandNotFoundHandler;

@@ -220,3 +220,3 @@ this._unauthorizedHandler = options.commandUnauthorizedHandler;

if (!guild)
return console.log("guild not found");
return console.log(`${key} guild not found`);
// fetch already registered command

@@ -323,3 +323,3 @@ const existing = await guild.commands.fetch();

await Promise.all(commands.map(async (value) => {
const guildManager = await this.guilds.cache.get(guild);
const guildManager = this.guilds.cache.get(guild);
if (guildManager)

@@ -405,3 +405,2 @@ guildManager.commands.delete(value);

async executeInteraction(interaction) {
var _a, _b;
if (!interaction) {

@@ -418,3 +417,4 @@ if (!this.silent) {

(button.guilds.length &&
!button.guilds.includes((_a = interaction.guild) === null || _a === void 0 ? void 0 : _a.id)) ||
interaction.guild &&
!button.guilds.includes(interaction.guild.id)) ||
(button.botIds.length && !button.botIds.includes(this.botId)))

@@ -429,3 +429,4 @@ return console.log(`button interaction not found, interactionID: ${interaction.id} | customID: ${interaction.customId}`);

(menu.guilds.length &&
!menu.guilds.includes((_b = interaction.guild) === null || _b === void 0 ? void 0 : _b.id)) ||
interaction.guild &&
!menu.guilds.includes(interaction.guild.id)) ||
(menu.botIds.length && !menu.botIds.includes(this.botId)))

@@ -432,0 +433,0 @@ return console.log(`selectMenu interaction not found, interactionID: ${interaction.id} | customID: ${interaction.customId}`);

@@ -0,1 +1,2 @@

import { Snowflake } from "discord.js";
import { Method } from "./Method";

@@ -10,7 +11,7 @@ export declare class DButton extends Method {

set id(value: string);
get guilds(): string[];
set guilds(value: string[]);
protected constructor(id: string, guilds?: string[], botIds?: string[]);
static create(id: string, guilds?: string[], botIds?: string[]): DButton;
get guilds(): `${bigint}`[];
set guilds(value: `${bigint}`[]);
protected constructor(id: string, guilds?: Snowflake[], botIds?: string[]);
static create(id: string, guilds?: Snowflake[], botIds?: string[]): DButton;
parseParams(): never[];
}

@@ -1,2 +0,2 @@

import { ApplicationCommandPermissionData } from "discord.js";
import { ApplicationCommandPermissionData, Snowflake } from "discord.js";
import { CommandMessage } from "../../types/public/CommandMessage";

@@ -22,4 +22,4 @@ import { DCommandOption } from "./DCommandOption";

set permissions(value: ApplicationCommandPermissionData[]);
get guilds(): string[];
set guilds(value: string[]);
get guilds(): `${bigint}`[];
set guilds(value: `${bigint}`[]);
get argSplitter(): string;

@@ -37,5 +37,5 @@ set argSplitter(value: string);

set options(value: DCommandOption[]);
protected constructor(name: string, description?: string, argSplitter?: string, directMessage?: boolean, defaultPermission?: boolean, guilds?: string[], botIds?: string[], aliases?: string[]);
static create(name: string, description?: string, argSplitter?: string, directMessage?: boolean, defaultPermission?: boolean, guilds?: string[], botIds?: string[], aliases?: string[]): DCommand;
protected constructor(name: string, description?: string, argSplitter?: string, directMessage?: boolean, defaultPermission?: boolean, guilds?: Snowflake[], botIds?: string[], aliases?: string[]);
static create(name: string, description?: string, argSplitter?: string, directMessage?: boolean, defaultPermission?: boolean, guilds?: Snowflake[], botIds?: string[], aliases?: string[]): DCommand;
parseParams(message: CommandMessage): (string | number | boolean | undefined)[];
}

@@ -24,4 +24,4 @@ import { Decorator } from "./Decorator";

set botIds(value: string[]);
get guilds(): string[];
set guilds(value: string[]);
get guilds(): `${bigint}`[];
set guilds(value: `${bigint}`[]);
get defaultPermission(): boolean;

@@ -28,0 +28,0 @@ set defaultPermission(value: boolean);

@@ -0,1 +1,2 @@

import { Snowflake } from "discord.js";
import { Method } from "./Method";

@@ -10,7 +11,7 @@ export declare class DSelectMenu extends Method {

set id(value: string);
get guilds(): string[];
set guilds(value: string[]);
protected constructor(id: string, guilds?: string[], botIds?: string[]);
static create(id: string, guilds?: string[], botIds?: string[]): DSelectMenu;
get guilds(): `${bigint}`[];
set guilds(value: `${bigint}`[]);
protected constructor(id: string, guilds?: Snowflake[], botIds?: string[]);
static create(id: string, guilds?: Snowflake[], botIds?: string[]): DSelectMenu;
parseParams(): never[];
}

@@ -1,2 +0,2 @@

import { ApplicationCommandData, ApplicationCommandPermissionData, CommandInteraction, CommandInteractionOption } from "discord.js";
import { ApplicationCommandData, ApplicationCommandPermissionData, CommandInteraction, CommandInteractionOption, Snowflake } from "discord.js";
import { DOption } from "../..";

@@ -22,4 +22,4 @@ import { Method } from "./Method";

set permissions(value: ApplicationCommandPermissionData[]);
get guilds(): string[];
set guilds(value: string[]);
get guilds(): `${bigint}`[];
set guilds(value: `${bigint}`[]);
get defaultPermission(): boolean;

@@ -33,4 +33,4 @@ set defaultPermission(value: boolean);

set options(value: DOption[]);
protected constructor(name: string, description?: string, defaultPermission?: boolean, guilds?: string[], botIds?: string[]);
static create(name: string, description?: string, defaultPermission?: boolean, guilds?: string[], botIds?: string[]): DSlash;
protected constructor(name: string, description?: string, defaultPermission?: boolean, guilds?: Snowflake[], botIds?: string[]);
static create(name: string, description?: string, defaultPermission?: boolean, guilds?: Snowflake[], botIds?: string[]): DSlash;
toSubCommand(): DOption;

@@ -37,0 +37,0 @@ toObject(): ApplicationCommandData;

@@ -0,3 +1,4 @@

import { Snowflake } from "discord.js";
import { ClassMethodDecorator } from "../../types/public/decorators";
export declare function Guild(guildID: string): ClassMethodDecorator;
export declare function Guild(...guildIDs: string[]): ClassMethodDecorator;
export declare function Guild(guildID: Snowflake): ClassMethodDecorator;
export declare function Guild(...guildIDs: Snowflake[]): ClassMethodDecorator;

@@ -0,4 +1,5 @@

import { Snowflake } from "discord.js";
export declare function SelectMenu(id: string, params?: {
guilds?: string[];
guilds?: Snowflake[];
botIds?: string[];
}): (target: Record<string, any>, key: string) => void;

@@ -0,1 +1,2 @@

import { Snowflake } from "discord.js";
export interface CommandParams {

@@ -6,5 +7,5 @@ argSplitter?: string;

defaultPermission?: boolean;
guilds?: string[];
guilds?: Snowflake[];
botIds?: string[];
aliases?: string[];
}

@@ -0,6 +1,7 @@

import { Snowflake } from "discord.js";
export interface SlashParams {
description?: string;
defaultPermission?: boolean;
guilds?: string[];
guilds?: Snowflake[];
botIds?: string[];
}

@@ -1,2 +0,2 @@

import { ClientOptions as DiscordJSClientOptions, Message } from "discord.js";
import { ClientOptions as DiscordJSClientOptions, Message, Snowflake } from "discord.js";
import { DCommand } from "../../decorators/classes/DCommand";

@@ -21,3 +21,3 @@ import { GuardFunction } from "../public/GuardFunction";

/**
* define bot reply, when command not found
* define bot reply, when command is not auhorized
*/

@@ -48,3 +48,3 @@ commandUnauthorizedHandler?: string | ((message: Message, info: {

*/
slashGuilds?: string[];
slashGuilds?: Snowflake[];
}
{
"name": "discordx",
"version": "5.1.8",
"version": "5.1.9",
"description": "Create your discord bot by using TypeScript and decorators!",

@@ -5,0 +5,0 @@ "main": "build/index.js",

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc