New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@notenoughupdates/discord-akairo

Package Overview
Dependencies
Maintainers
1
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@notenoughupdates/discord-akairo - npm Package Compare versions

Comparing version 9.1.3-dev.1655295899.4b4497b to 9.1.3-dev.1655341685.1230a9d

2

dist/package.json
{
"name": "@notenoughupdates/discord-akairo",
"version": "9.1.3-dev.1655295899.4b4497b",
"version": "9.1.3-dev.1655341685.1230a9d",
"description": "A highly customizable bot framework for Discord.js.",

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

@@ -153,3 +153,5 @@ "use strict";

}
return Flag_js_1.Flag.cancel();
if (!promptOptions.time)
return Flag_js_1.Flag.cancel();
return Flag_js_1.Flag.timeout(promptOptions.time);
}

@@ -156,0 +158,0 @@ if (promptOptions.breakout) {

@@ -765,2 +765,6 @@ "use strict";

}
else if (Flag_js_1.Flag.is(args, Flag_js_1.FlagType.Timeout)) {
this.emit(Constants_js_1.CommandHandlerEvents.COMMAND_TIMEOUT, message, command, args.time);
return true;
}
else if (Flag_js_1.Flag.is(args, Flag_js_1.FlagType.Retry)) {

@@ -767,0 +771,0 @@ this.emit(Constants_js_1.CommandHandlerEvents.COMMAND_BREAKOUT, message, command, args.message);

@@ -11,2 +11,8 @@ import type { Message } from "discord.js";

/**
* Order waiting time .
*
* Only exists if {@link type} is {@link FlagType.Timeout}.
*/
time: T extends FlagType.Timeout ? number : never;
/**
* Message to handle.

@@ -49,2 +55,3 @@ *

private constructor();
private constructor();
/**

@@ -55,2 +62,6 @@ * Creates a flag that cancels the command.

/**
* Create a flag that cancels the command because of the timeout
*/
static timeout(time: number): Flag<FlagType.Timeout>;
/**
* Creates a flag that retries with another input.

@@ -78,2 +89,3 @@ * @param message - Message to handle.

static is(value: unknown, type: FlagType.Cancel): value is Flag<FlagType.Cancel>;
static is(value: unknown, type: FlagType.Timeout): value is Flag<FlagType.Timeout>;
static is(value: unknown, type: FlagType.Continue): value is Flag<FlagType.Continue>;

@@ -85,2 +97,3 @@ static is(value: unknown, type: FlagType.Fail): value is Flag<FlagType.Fail>;

Cancel = "cancel",
Timeout = "timeout",
Retry = "retry",

@@ -87,0 +100,0 @@ Fail = "fail",

@@ -19,2 +19,8 @@ "use strict";

/**
* Create a flag that cancels the command because of the timeout
*/
static timeout(time) {
return new Flag(FlagType.Timeout, { time });
}
/**
* Creates a flag that retries with another input.

@@ -50,2 +56,3 @@ * @param message - Message to handle.

FlagType["Cancel"] = "cancel";
FlagType["Timeout"] = "timeout";
FlagType["Retry"] = "retry";

@@ -52,0 +59,0 @@ FlagType["Fail"] = "fail";

@@ -46,2 +46,9 @@ import type { ChatInputCommandInteraction, ClientEvents, ContextMenuCommandInteraction, Message } from "discord.js";

/**
* Emitted when a command is cancelled because of a timeout.
* @param message - Message sent.
* @param command - Command executed.
* @param time - Timeout in milliseconds.
*/
commandTimeout: [message: Message, command: Command, time: number];
/**
* Emitted when a command finishes execution.

@@ -48,0 +55,0 @@ * @param message - Message sent.

@@ -76,2 +76,3 @@ export declare enum ArgumentMatches {

COMMAND_CANCELLED = "commandCancelled",
COMMAND_TIMEOUT = "commandTimeout",
COMMAND_FINISHED = "commandFinished",

@@ -78,0 +79,0 @@ COMMAND_INVALID = "commandInvalid",

@@ -83,2 +83,3 @@ "use strict";

CommandHandlerEvents["COMMAND_CANCELLED"] = "commandCancelled";
CommandHandlerEvents["COMMAND_TIMEOUT"] = "commandTimeout";
CommandHandlerEvents["COMMAND_FINISHED"] = "commandFinished";

@@ -85,0 +86,0 @@ CommandHandlerEvents["COMMAND_INVALID"] = "commandInvalid";

@@ -177,2 +177,3 @@ "use strict";

exports.isStringArrayStringOrFunc = isStringArrayStringOrFunc;
/* eslint-disable @typescript-eslint/ban-types, func-names */
/**

@@ -183,3 +184,2 @@ * Defines an abstract method to a class to produce a runtime error.

*/
// eslint-disable-next-line @typescript-eslint/ban-types
function patchAbstract(Class, method) {

@@ -190,5 +190,4 @@ Object.defineProperty(Class.prototype, method, {

writable: true,
// eslint-disable-next-line func-names
value: function () {
throw new AkairoError_js_1.AkairoError("NOT_IMPLEMENTED", Class.name, method);
throw new AkairoError_js_1.AkairoError("NOT_IMPLEMENTED", this.constructor.name, method);
}

@@ -198,2 +197,3 @@ });

exports.patchAbstract = patchAbstract;
/* eslint-enable @typescript-eslint/ban-types, func-names */
//# sourceMappingURL=Util.js.map
{
"name": "@notenoughupdates/discord-akairo",
"version": "9.1.3-dev.1655295899.4b4497b",
"version": "9.1.3-dev.1655341685.1230a9d",
"description": "A highly customizable bot framework for Discord.js.",

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

@@ -314,4 +314,4 @@ import type {

}
return Flag.cancel();
if (!promptOptions.time) return Flag.cancel();
return Flag.timeout(promptOptions.time);
}

@@ -318,0 +318,0 @@

@@ -1025,2 +1025,5 @@ import {

return true;
} else if (Flag.is(args, FlagType.Timeout)) {
this.emit(CommandHandlerEvents.COMMAND_TIMEOUT, message, command, args.time);
return true;
} else if (Flag.is(args, FlagType.Retry)) {

@@ -1027,0 +1030,0 @@ this.emit(CommandHandlerEvents.COMMAND_BREAKOUT, message, command, args.message);

@@ -13,2 +13,9 @@ import type { Message } from "discord.js";

/**
* Order waiting time .
*
* Only exists if {@link type} is {@link FlagType.Timeout}.
*/
public declare time: T extends FlagType.Timeout ? number : never;
/**
* Message to handle.

@@ -53,6 +60,10 @@ *

private constructor(type: T & FlagType.Cancel);
private constructor(type: T & FlagType.Timeout, data?: FlagTimeoutData);
private constructor(type: T & FlagType.Retry, data?: FlagRetryData);
private constructor(type: T & FlagType.Fail, data?: FlagFailData);
private constructor(type: T & FlagType.Continue, data?: FlagContinueData);
private constructor(type: T, data: Record<string, never> | FlagRetryData | FlagFailData | FlagContinueData = {}) {
private constructor(
type: T,
data: Record<string, never> | FlagTimeoutData | FlagRetryData | FlagFailData | FlagContinueData = {}
) {
this.type = type;

@@ -70,2 +81,9 @@ Object.assign(this, data);

/**
* Create a flag that cancels the command because of the timeout
*/
public static timeout(time: number): Flag<FlagType.Timeout> {
return new Flag(FlagType.Timeout, { time });
}
/**
* Creates a flag that retries with another input.

@@ -102,2 +120,3 @@ * @param message - Message to handle.

public static is(value: unknown, type: FlagType.Cancel): value is Flag<FlagType.Cancel>;
public static is(value: unknown, type: FlagType.Timeout): value is Flag<FlagType.Timeout>;
public static is(value: unknown, type: FlagType.Continue): value is Flag<FlagType.Continue>;

@@ -113,2 +132,3 @@ public static is(value: unknown, type: FlagType.Fail): value is Flag<FlagType.Fail>;

Cancel = "cancel",
Timeout = "timeout",
Retry = "retry",

@@ -119,2 +139,6 @@ Fail = "fail",

interface FlagTimeoutData {
time: number;
}
interface FlagRetryData {

@@ -121,0 +145,0 @@ message: Message;

@@ -52,2 +52,10 @@ import type { ChatInputCommandInteraction, ClientEvents, ContextMenuCommandInteraction, Message } from "discord.js";

/**
* Emitted when a command is cancelled because of a timeout.
* @param message - Message sent.
* @param command - Command executed.
* @param time - Timeout in milliseconds.
*/
commandTimeout: [message: Message, command: Command, time: number];
/**
* Emitted when a command finishes execution.

@@ -54,0 +62,0 @@ * @param message - Message sent.

@@ -79,2 +79,3 @@ export enum ArgumentMatches {

COMMAND_CANCELLED = "commandCancelled",
COMMAND_TIMEOUT = "commandTimeout",
COMMAND_FINISHED = "commandFinished",

@@ -81,0 +82,0 @@ COMMAND_INVALID = "commandInvalid",

@@ -184,2 +184,3 @@ import EventEmitter from "node:events";

/* eslint-disable @typescript-eslint/ban-types, func-names */
/**

@@ -190,3 +191,2 @@ * Defines an abstract method to a class to produce a runtime error.

*/
// eslint-disable-next-line @typescript-eslint/ban-types
export function patchAbstract(Class: Function, method: string): void {

@@ -197,7 +197,7 @@ Object.defineProperty(Class.prototype, method, {

writable: true,
// eslint-disable-next-line func-names
value: function () {
throw new AkairoError("NOT_IMPLEMENTED", Class.name, method);
throw new AkairoError("NOT_IMPLEMENTED", this.constructor.name, method);
}
});
}
/* eslint-enable @typescript-eslint/ban-types, func-names */

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

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