Socket
Socket
Sign inDemoInstall

@notenoughupdates/discord-akairo

Package Overview
Dependencies
1
Maintainers
1
Versions
140
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 9.1.3-dev.1644799330.8fbaf39 to 9.1.3-dev.1649679866.5536822

.prettierrc.json

40

dist/package.json
{
"name": "@notenoughupdates/discord-akairo",
"version": "9.1.3-dev.1644799330.8fbaf39",
"version": "9.1.3-dev.1649679866.5536822",
"description": "A highly customizable bot framework for Discord.js.",

@@ -39,35 +39,23 @@ "main": "./dist/src/index.js",

},
"dependencies": {},
"devDependencies": {
"@discordjs/voice": "^0.7.5",
"@favware/npm-deprecate": "^1.0.4",
"@types/node": "^17.0.10",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"copyfiles": "^2.4.1",
"discord-api-types": "^0.26.1",
"discord-api-types": "0.31.0",
"discord.js": "npm:@notenoughupdates/discord.js@dev",
"eslint": "^8.7.0",
"eslint-config-prettier": "^8.3.0",
"eslint": "^8.13.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-deprecation": "^1.3.2",
"node-fetch": "^3.2.0",
"prettier": "^2.5.1",
"node-fetch": "^3.2.3",
"prettier": "^2.6.2",
"rimraf": "^3.0.2",
"typedoc": "^0.22.11",
"typescript": "^4.5.4"
"typedoc": "^0.22.15",
"typescript": "^4.6.3"
},
"prettier": {
"useTabs": true,
"trailingComma": "none",
"arrowParens": "avoid",
"printWidth": 130,
"overrides": [
{
"files": "*.md",
"options": {
"useTabs": false
}
}
]
"packageManager": "yarn@3.1.1",
"dependencies": {
"@sapphire/shapeshift": "^2.0.0"
}
}
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

/// <reference types="node" />
import { APIEmbed } from "discord-api-types";
import { BufferResolvable, Collection, Embed, Emoji, Guild, GuildChannel, GuildMember, MessageAttachment, PermissionsString, Role, Snowflake, ThreadChannel, User } from "discord.js";
import { APIEmbed } from "discord-api-types/v10";
import { BufferResolvable, Collection, EmbedBuilder, EmbedData, Emoji, Guild, GuildChannel, GuildMember, MessageAttachment, PermissionsString, Role, Snowflake, ThreadChannel, User } from "discord.js";
import type { Stream } from "stream";

@@ -88,3 +88,3 @@ import type { AkairoClient } from "./AkairoClient.js";

*/
embed(data?: Embed | APIEmbed): Embed;
embed(data?: EmbedData | APIEmbed): EmbedBuilder;
/**

@@ -91,0 +91,0 @@ * Combination of `<Client>.fetchUser()` and `<Guild>.fetchMember()`.

@@ -166,4 +166,4 @@ "use strict";

compareStreaming(oldMember, newMember) {
const s1 = oldMember.presence?.activities.find(c => c.type === 1 /* Streaming */);
const s2 = newMember.presence?.activities.find(c => c.type === 1 /* Streaming */);
const s1 = oldMember.presence?.activities.find(c => c.type === discord_js_1.ActivityType.Streaming);
const s2 = newMember.presence?.activities.find(c => c.type === discord_js_1.ActivityType.Streaming);
if (s1 === s2)

@@ -182,3 +182,3 @@ return 0;

embed(data) {
return new discord_js_1.Embed(data);
return new discord_js_1.EmbedBuilder(data);
}

@@ -185,0 +185,0 @@ /**

/// <reference types="node" />
import type { BaseGuildVoiceChannel, CategoryChannel, Collection, Emoji, Guild, GuildBasedChannel, GuildChannel, GuildEmoji, GuildMember, Invite, Message, MessageOptions, MessagePayload, NewsChannel, Role, StageChannel, StoreChannel, TextChannel, ThreadChannel, User, VoiceChannel } from "discord.js";
import type { BaseGuildVoiceChannel, CategoryChannel, Collection, Emoji, Guild, GuildBasedChannel, GuildChannel, GuildEmoji, GuildMember, Invite, Message, MessageOptions, MessagePayload, NewsChannel, Role, StageChannel, TextChannel, ThreadChannel, User, VoiceChannel } from "discord.js";
import type { URL } from "url";

@@ -337,3 +337,3 @@ import type { AkairoClient } from "../../AkairoClient.js";

* The command to be run may be the same command or some other command.
* Defaults to true,
* @default true
*/

@@ -346,3 +346,4 @@ breakout?: boolean;

/**
* Word to use for cancelling the command. Defaults to 'cancel'.
* Word to use for cancelling the command.
* @default "cancel"
*/

@@ -358,7 +359,8 @@ cancelWord?: string;

* The final evaluated argument will be an array of the inputs.
* Defaults to false.
* @default false
*/
infinite?: boolean;
/**
* Amount of inputs allowed for an infinite prompt before finishing. Defaults to Infinity.
* Amount of inputs allowed for an infinite prompt before finishing.
* @default Infinity.
*/

@@ -387,7 +389,9 @@ limit?: number;

/**
* Prompts only when argument is provided but was not of the right type. Defaults to false.
* Prompts only when argument is provided but was not of the right type.
* @default false
*/
optional?: boolean;
/**
* Amount of retries allowed. Defaults to 1.
* Amount of retries allowed.
* @default 1
*/

@@ -404,7 +408,9 @@ retries?: number;

/**
* Word to use for ending infinite prompts. Defaults to 'stop'.
* Word to use for ending infinite prompts.
* @default "stop"
*/
stopWord?: string;
/**
* Time to wait for input. Defaults to 30000.
* Time to wait for input.
* @default 30000
*/

@@ -468,3 +474,2 @@ time?: number;

* - `newsChannel` tries to resolve to a news channel.
* - `storeChannel` tries to resolve to a store channel.
* - `stageChannel` tries to resolve to a stage channel.

@@ -515,4 +520,2 @@ * - `threadChannel` tries to resolve a thread channel.

newsChannels: Collection<string, NewsChannel> | null;
storeChannel: StoreChannel | null;
storeChannels: Collection<string, StoreChannel> | null;
stageChannel: StageChannel | null;

@@ -617,3 +620,3 @@ stageChannels: Collection<string, StageChannel> | null;

*/
export declare type OtherwiseContentModifier = (message: Message, text: string, data: FailureData) => string | MessagePayload | MessageOptions | Promise<string | MessagePayload | MessageOptions>;
export declare type OtherwiseContentModifier = (message: Message, text: string | MessagePayload | MessageOptions | OtherwiseContentSupplier, data: FailureData) => string | MessagePayload | MessageOptions | Promise<string | MessagePayload | MessageOptions>;
/**

@@ -631,3 +634,3 @@ * A function returning the content if argument parsing fails.

*/
export declare type PromptContentModifier = (message: Message, text: string, data: ArgumentPromptData) => string | MessagePayload | MessageOptions | Promise<string | MessagePayload | MessageOptions>;
export declare type PromptContentModifier = (message: Message, text: string | MessagePayload | MessageOptions | OtherwiseContentSupplier, data: ArgumentPromptData) => string | MessagePayload | MessageOptions | Promise<string | MessagePayload | MessageOptions>;
/**

@@ -634,0 +637,0 @@ * A function returning text for the prompt.

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

: this.client.util.resolveUser(phrase, new discord_js_1.Collection([
[message.channel.recipient.id, message.channel.recipient],
[message.channel.recipientId, message.channel.recipient],
[this.client.user.id, this.client.user]

@@ -148,3 +148,3 @@ ]));

: this.client.util.resolveUsers(phrase, new discord_js_1.Collection([
[message.channel.recipient.id, message.channel.recipient],
[message.channel.recipientId, message.channel.recipient],
[this.client.user.id, this.client.user]

@@ -255,24 +255,2 @@ ]));

},
[Constants_js_1.ArgumentTypes.STORE_CHANNEL]: (message, phrase) => {
if (!phrase)
return null;
if (!message.inGuild())
return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (!channel || !channel.isStore())
return null;
return channel;
},
[Constants_js_1.ArgumentTypes.STORE_CHANNELS]: (message, phrase) => {
if (!phrase)
return null;
if (!message.inGuild())
return null;
const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);
if (!channels.size)
return null;
// eslint-disable-next-line deprecation/deprecation
const storeChannels = channels.filter(c => c.isStore());
return storeChannels.size ? storeChannels : null;
},
[Constants_js_1.ArgumentTypes.STAGE_CHANNEL]: (message, phrase) => {

@@ -296,4 +274,4 @@ if (!phrase)

return null;
const storeChannels = channels.filter(c => c.isStage());
return storeChannels.size ? storeChannels : null;
const stageChannels = channels.filter(c => c.isStage());
return stageChannels.size ? stageChannels : null;
},

@@ -318,4 +296,4 @@ [Constants_js_1.ArgumentTypes.THREAD_CHANNEL]: (message, phrase) => {

return null;
const storeChannels = channels.filter(c => c.isThread());
return storeChannels.size ? storeChannels : null;
const threadChannels = channels.filter(c => c.isThread());
return threadChannels.size ? threadChannels : null;
},

@@ -322,0 +300,0 @@ [Constants_js_1.ArgumentTypes.ROLE]: (message, phrase) => {

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

defaultPermission: data.slashDefaultPermission,
type: 1 /* ChatInput */
type: discord_js_1.ApplicationCommandType.ChatInput
});

@@ -228,4 +228,4 @@ }

name: options.name,
description: options.type === 1 /* ChatInput */ ? options.description ?? "" : undefined,
options: options.type === 1 /* ChatInput */ ? options.options ?? [] : undefined,
description: options.type === discord_js_1.ApplicationCommandType.ChatInput ? options.description ?? "" : undefined,
options: options.type === discord_js_1.ApplicationCommandType.ChatInput ? options.options ?? [] : undefined,
defaultPermission: options.defaultPermission,

@@ -275,4 +275,4 @@ type: options.type

name: options.name,
description: options.type === 1 /* ChatInput */ ? options.description ?? "" : undefined,
options: options.type === 1 /* ChatInput */ ? options.options ?? [] : undefined,
description: options.type === discord_js_1.ApplicationCommandType.ChatInput ? options.description ?? "" : undefined,
options: options.type === discord_js_1.ApplicationCommandType.ChatInput ? options.options ?? [] : undefined,
defaultPermission: options.defaultPermission,

@@ -342,3 +342,3 @@ type: options.type

id: u,
type: 2 /* User */,
type: discord_js_1.ApplicationCommandPermissionType.User,
permission: true

@@ -578,7 +578,7 @@ }))

for (const option of interaction.options["_hoistedOptions"]) {
if (option.type === 1 /* Subcommand */ ||
option.type === 2 /* SubcommandGroup */)
if (option.type === discord_js_1.ApplicationCommandOptionType.Subcommand ||
option.type === discord_js_1.ApplicationCommandOptionType.SubcommandGroup)
continue;
const originalOption = commandModule.slashOptions?.find(o => o.name === option.name);
const func = `get${originalOption?.resolve ?? AkairoApplicationCommandOptionType[option.type]}`;
const func = `get${originalOption?.resolve ?? discord_js_1.ApplicationCommandOptionType[option.type]}`;
if (![

@@ -606,3 +606,3 @@ "getBoolean",

}
if (usedSubcommandOrGroup.type === 1 /* Subcommand */) {
if (usedSubcommandOrGroup.type === discord_js_1.ApplicationCommandOptionType.Subcommand) {
if (!usedSubcommandOrGroup.options) {

@@ -614,3 +614,3 @@ this.client.emit("akairoDebug", "[handleSlash] Unable to find subcommand options");

}
else if (usedSubcommandOrGroup.type === 2 /* SubcommandGroup */) {
else if (usedSubcommandOrGroup.type === discord_js_1.ApplicationCommandOptionType.SubcommandGroup) {
const usedSubCommand = usedSubcommandOrGroup.options?.find(subcommand => subcommand.name === convertedOptions.subcommand);

@@ -637,12 +637,12 @@ if (!usedSubCommand) {

switch (option.type) {
case 5 /* Boolean */:
case discord_js_1.ApplicationCommandOptionType.Boolean:
convertedOptions[option.name] ??= false;
break;
case 7 /* Channel */:
case 4 /* Integer */:
case 9 /* Mentionable */:
case 10 /* Number */:
case 8 /* Role */:
case 3 /* String */:
case 6 /* User */:
case discord_js_1.ApplicationCommandOptionType.Channel:
case discord_js_1.ApplicationCommandOptionType.Integer:
case discord_js_1.ApplicationCommandOptionType.Mentionable:
case discord_js_1.ApplicationCommandOptionType.Number:
case discord_js_1.ApplicationCommandOptionType.Role:
case discord_js_1.ApplicationCommandOptionType.String:
case discord_js_1.ApplicationCommandOptionType.User:
default:

@@ -983,4 +983,4 @@ convertedOptions[option.name] ??= null;

}
else if (message.guild) {
if (message.channel?.type === 1 /* DM */)
else if (message.inGuild()) {
if (!message.channel || message.channel.isDMBased())
return false;

@@ -1011,4 +1011,4 @@ const missing = message.channel?.permissionsFor(message.guild.me)?.missing(command.clientPermissions);

}
else if (message.guild) {
if (message.channel?.type === 1 /* DM */)
else if (message.inGuild()) {
if (!message.channel || message.channel.isDMBased())
return false;

@@ -1284,2 +1284,6 @@ const missing = message.channel?.permissionsFor(message.author)?.missing(command.userPermissions);

class RegisterInteractionCommandError extends Error {
original;
type;
data;
guild;
constructor(original, type, data, guild = null) {

@@ -1295,22 +1299,3 @@ super("Failed to register interaction commands.");

const slashResolvable = ["Boolean", "Channel", "String", "Integer", "Number", "User", "Member", "Role", "Mentionable"];
// todo: remove this once discord-api-types updates
/**
* Used for reverse mapping since discord exports its enums as const enums.
* @internal
*/
var AkairoApplicationCommandOptionType;
(function (AkairoApplicationCommandOptionType) {
AkairoApplicationCommandOptionType[AkairoApplicationCommandOptionType["Subcommand"] = 1] = "Subcommand";
AkairoApplicationCommandOptionType[AkairoApplicationCommandOptionType["SubcommandGroup"] = 2] = "SubcommandGroup";
AkairoApplicationCommandOptionType[AkairoApplicationCommandOptionType["String"] = 3] = "String";
AkairoApplicationCommandOptionType[AkairoApplicationCommandOptionType["Integer"] = 4] = "Integer";
AkairoApplicationCommandOptionType[AkairoApplicationCommandOptionType["Boolean"] = 5] = "Boolean";
// eslint-disable-next-line @typescript-eslint/no-shadow
AkairoApplicationCommandOptionType[AkairoApplicationCommandOptionType["User"] = 6] = "User";
AkairoApplicationCommandOptionType[AkairoApplicationCommandOptionType["Channel"] = 7] = "Channel";
AkairoApplicationCommandOptionType[AkairoApplicationCommandOptionType["Role"] = 8] = "Role";
AkairoApplicationCommandOptionType[AkairoApplicationCommandOptionType["Mentionable"] = 9] = "Mentionable";
AkairoApplicationCommandOptionType[AkairoApplicationCommandOptionType["Number"] = 10] = "Number";
})(AkairoApplicationCommandOptionType || (AkairoApplicationCommandOptionType = {}));
/**
* @typedef {CommandInteractionOptionResolver} VSCodePleaseStopRemovingMyImports

@@ -1317,0 +1302,0 @@ * @internal

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

import { APIMessage } from "discord-api-types/v9";
import { APIMessage } from "discord-api-types/v10";
import { Collection, InteractionReplyOptions, Message, MessageEditOptions, MessageOptions, MessagePayload, ReplyMessageOptions, Snowflake, WebhookEditMessageOptions } from "discord.js";

@@ -3,0 +3,0 @@ import { AkairoMessage } from "../../util/AkairoMessage.js";

@@ -12,2 +12,12 @@ "use strict";

/**
* Saved deleted message ids.
*/
static deletedMessages = new Set();
/**
* Whether or not `this.message` has been deleted.
*/
get deleted() {
return this.isSlash ? false : CommandUtil.deletedMessages.has(this.message.id);
}
/**
* @param handler - The command handler.

@@ -26,8 +36,2 @@ * @param message - Message that triggered the command.

/**
* Whether or not `this.message` has been deleted.
*/
get deleted() {
return this.isSlash ? false : CommandUtil.deletedMessages.has(this.message.id);
}
/**
* Whether or not the provided message is a slash message

@@ -146,6 +150,2 @@ * @param message - The message to test

exports.CommandUtil = CommandUtil;
/**
* Saved deleted message ids.
*/
CommandUtil.deletedMessages = new Set();
//# sourceMappingURL=CommandUtil.js.map

@@ -206,2 +206,9 @@ "use strict";

class Parser {
/**
* Phrases are `{ type: 'Phrase', value, raw }`.
* Flags are `{ type: 'Flag', key, raw }`.
* Option flags are `{ type: 'OptionFlag', key, value, raw }`.
* The `all` property is partitioned into `phrases`, `flags`, and `optionFlags`.
*/
results;
constructor(tokens, options) {

@@ -208,0 +215,0 @@ const { separated } = options;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContextMenuCommand = void 0;
/* eslint-disable func-names, @typescript-eslint/no-unused-vars */
const discord_js_1 = require("discord.js");
const AkairoError_js_1 = require("../../util/AkairoError.js");

@@ -25,3 +27,3 @@ const Util_js_1 = require("../../util/Util.js");

throw new TypeError("options.ownerOnly must be a boolean");
if (type !== 2 /* User */ && type !== 3 /* Message */)
if (type !== discord_js_1.ApplicationCommandType.User && type !== discord_js_1.ApplicationCommandType.Message)
throw new TypeError("options.type must be either ApplicationCommandType.User or ApplicationCommandType.Message.");

@@ -28,0 +30,0 @@ super(id, { category });

import type { Message } from "discord.js";
import type { AkairoMessage } from "../../util/AkairoMessage.js";
import type { Category } from "../../util/Category.js";
import type { AkairoClient } from "../AkairoClient.js";
import { AkairoModule, AkairoModuleOptions } from "../AkairoModule.js";

@@ -21,10 +20,2 @@ import type { Command } from "../commands/Command.js";

/**
* The Akairo client.
*/
client: AkairoClient;
/**
* The filepath.
*/
filepath: string;
/**
* The inhibitor handler.

@@ -72,3 +63,2 @@ */

* Options to use for inhibitor execution behavior.
* Also includes properties from AkairoModuleOptions.
*/

@@ -75,0 +65,0 @@ export interface InhibitorOptions extends AkairoModuleOptions {

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

import type { APIInteractionGuildMember, APIMessage } from "discord-api-types/v9";
import type { APIInteractionGuildMember, APIMessage } from "discord-api-types/v10";
import { Base, ChatInputCommandInteraction, Guild, GuildMember, GuildTextBasedChannel, InteractionReplyOptions, Message, MessagePayload, Snowflake, TextBasedChannel, User } from "discord.js";

@@ -3,0 +3,0 @@ import type { AkairoClient } from "../struct/AkairoClient.js";

@@ -1,111 +0,109 @@

export declare const ArgumentMatches: Readonly<{
readonly PHRASE: "phrase";
readonly FLAG: "flag";
readonly OPTION: "option";
readonly REST: "rest";
readonly SEPARATE: "separate";
readonly TEXT: "text";
readonly CONTENT: "content";
readonly REST_CONTENT: "restContent";
readonly NONE: "none";
}>;
export declare const ArgumentTypes: Readonly<{
readonly STRING: "string";
readonly LOWERCASE: "lowercase";
readonly UPPERCASE: "uppercase";
readonly CHAR_CODES: "charCodes";
readonly NUMBER: "number";
readonly INTEGER: "integer";
readonly BIGINT: "bigint";
readonly EMOJINT: "emojint";
readonly URL: "url";
readonly DATE: "date";
readonly COLOR: "color";
readonly USER: "user";
readonly USERS: "users";
readonly MEMBER: "member";
readonly MEMBERS: "members";
readonly RELEVANT: "relevant";
readonly RELEVANTS: "relevants";
readonly CHANNEL: "channel";
readonly CHANNELS: "channels";
readonly TEXT_CHANNEL: "textChannel";
readonly TEXT_CHANNELS: "textChannels";
readonly VOICE_CHANNEL: "voiceChannel";
readonly VOICE_CHANNELS: "voiceChannels";
readonly CATEGORY_CHANNEL: "categoryChannel";
readonly CATEGORY_CHANNELS: "categoryChannels";
readonly NEWS_CHANNEL: "newsChannel";
readonly NEWS_CHANNELS: "newsChannels";
readonly STORE_CHANNEL: "storeChannel";
readonly STORE_CHANNELS: "storeChannels";
readonly STAGE_CHANNEL: "stageChannel";
readonly STAGE_CHANNELS: "stageChannels";
readonly THREAD_CHANNEL: "threadChannel";
readonly THREAD_CHANNELS: "threadChannels";
readonly ROLE: "role";
readonly ROLES: "roles";
readonly EMOJI: "emoji";
readonly EMOJIS: "emojis";
readonly GUILD: "guild";
readonly GUILDS: "guilds";
readonly MESSAGE: "message";
readonly GUILD_MESSAGE: "guildMessage";
readonly RELEVANT_MESSAGE: "relevantMessage";
readonly INVITE: "invite";
readonly USER_MENTION: "userMention";
readonly MEMBER_MENTION: "memberMention";
readonly CHANNEL_MENTION: "channelMention";
readonly ROLE_MENTION: "roleMention";
readonly EMOJI_MENTION: "emojiMention";
readonly COMMAND_ALIAS: "commandAlias";
readonly COMMAND: "command";
readonly INHIBITOR: "inhibitor";
readonly LISTENER: "listener";
readonly TASK: "task";
readonly CONTEXT_MENU_COMMAND: "contextMenuCommand";
}>;
export declare const AkairoHandlerEvents: Readonly<{
readonly LOAD: "load";
readonly REMOVE: "remove";
}>;
export declare const CommandHandlerEvents: Readonly<{
readonly COMMAND_BLOCKED: "commandBlocked";
readonly COMMAND_BREAKOUT: "commandBreakout";
readonly COMMAND_CANCELLED: "commandCancelled";
readonly COMMAND_FINISHED: "commandFinished";
readonly COMMAND_INVALID: "commandInvalid";
readonly COMMAND_LOCKED: "commandLocked";
readonly COMMAND_STARTED: "commandStarted";
readonly COOLDOWN: "cooldown";
readonly ERROR: "error";
readonly IN_PROMPT: "inPrompt";
readonly MESSAGE_BLOCKED: "messageBlocked";
readonly MESSAGE_INVALID: "messageInvalid";
readonly MISSING_PERMISSIONS: "missingPermissions";
readonly SLASH_BLOCKED: "slashBlocked";
readonly SLASH_ERROR: "slashError";
readonly SLASH_FINISHED: "slashFinished";
readonly SLASH_MISSING_PERMISSIONS: "slashMissingPermissions";
readonly SLASH_NOT_FOUND: "slashNotFound";
readonly SLASH_STARTED: "slashStarted";
readonly SLASH_ONLY: "slashOnly";
}>;
export declare const ContextCommandHandlerEvents: Readonly<{
readonly ERROR: "error";
readonly FINISHED: "finished";
readonly NOT_FOUND: "notFound";
readonly STARTED: "started";
readonly BLOCKED: "blocked";
}>;
export declare const BuiltInReasons: Readonly<{
readonly CLIENT: "client";
readonly BOT: "bot";
readonly OWNER: "owner";
readonly SUPER_USER: "superUser";
readonly GUILD: "guild";
readonly DM: "dm";
readonly AUTHOR_NOT_FOUND: "authorNotFound";
readonly NOT_NSFW: "notNsfw";
}>;
export declare enum ArgumentMatches {
PHRASE = "phrase",
FLAG = "flag",
OPTION = "option",
REST = "rest",
SEPARATE = "separate",
TEXT = "text",
CONTENT = "content",
REST_CONTENT = "restContent",
NONE = "none"
}
export declare enum ArgumentTypes {
STRING = "string",
LOWERCASE = "lowercase",
UPPERCASE = "uppercase",
CHAR_CODES = "charCodes",
NUMBER = "number",
INTEGER = "integer",
BIGINT = "bigint",
EMOJINT = "emojint",
URL = "url",
DATE = "date",
COLOR = "color",
USER = "user",
USERS = "users",
MEMBER = "member",
MEMBERS = "members",
RELEVANT = "relevant",
RELEVANTS = "relevants",
CHANNEL = "channel",
CHANNELS = "channels",
TEXT_CHANNEL = "textChannel",
TEXT_CHANNELS = "textChannels",
VOICE_CHANNEL = "voiceChannel",
VOICE_CHANNELS = "voiceChannels",
CATEGORY_CHANNEL = "categoryChannel",
CATEGORY_CHANNELS = "categoryChannels",
NEWS_CHANNEL = "newsChannel",
NEWS_CHANNELS = "newsChannels",
STAGE_CHANNEL = "stageChannel",
STAGE_CHANNELS = "stageChannels",
THREAD_CHANNEL = "threadChannel",
THREAD_CHANNELS = "threadChannels",
ROLE = "role",
ROLES = "roles",
EMOJI = "emoji",
EMOJIS = "emojis",
GUILD = "guild",
GUILDS = "guilds",
MESSAGE = "message",
GUILD_MESSAGE = "guildMessage",
RELEVANT_MESSAGE = "relevantMessage",
INVITE = "invite",
USER_MENTION = "userMention",
MEMBER_MENTION = "memberMention",
CHANNEL_MENTION = "channelMention",
ROLE_MENTION = "roleMention",
EMOJI_MENTION = "emojiMention",
COMMAND_ALIAS = "commandAlias",
COMMAND = "command",
INHIBITOR = "inhibitor",
LISTENER = "listener",
TASK = "task",
CONTEXT_MENU_COMMAND = "contextMenuCommand"
}
export declare enum AkairoHandlerEvents {
LOAD = "load",
REMOVE = "remove"
}
export declare enum CommandHandlerEvents {
COMMAND_BLOCKED = "commandBlocked",
COMMAND_BREAKOUT = "commandBreakout",
COMMAND_CANCELLED = "commandCancelled",
COMMAND_FINISHED = "commandFinished",
COMMAND_INVALID = "commandInvalid",
COMMAND_LOCKED = "commandLocked",
COMMAND_STARTED = "commandStarted",
COOLDOWN = "cooldown",
ERROR = "error",
IN_PROMPT = "inPrompt",
MESSAGE_BLOCKED = "messageBlocked",
MESSAGE_INVALID = "messageInvalid",
MISSING_PERMISSIONS = "missingPermissions",
SLASH_BLOCKED = "slashBlocked",
SLASH_ERROR = "slashError",
SLASH_FINISHED = "slashFinished",
SLASH_MISSING_PERMISSIONS = "slashMissingPermissions",
SLASH_NOT_FOUND = "slashNotFound",
SLASH_STARTED = "slashStarted",
SLASH_ONLY = "slashOnly"
}
export declare enum ContextCommandHandlerEvents {
ERROR = "error",
FINISHED = "finished",
NOT_FOUND = "notFound",
STARTED = "started",
BLOCKED = "blocked"
}
export declare enum BuiltInReasons {
CLIENT = "client",
BOT = "bot",
OWNER = "owner",
SUPER_USER = "superUser",
GUILD = "guild",
DM = "dm",
AUTHOR_NOT_FOUND = "authorNotFound",
NOT_NSFW = "notNsfw"
}
//# sourceMappingURL=Constants.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BuiltInReasons = exports.ContextCommandHandlerEvents = exports.CommandHandlerEvents = exports.AkairoHandlerEvents = exports.ArgumentTypes = exports.ArgumentMatches = void 0;
exports.ArgumentMatches = Object.freeze({
PHRASE: "phrase",
FLAG: "flag",
OPTION: "option",
REST: "rest",
SEPARATE: "separate",
TEXT: "text",
CONTENT: "content",
REST_CONTENT: "restContent",
NONE: "none"
});
exports.ArgumentTypes = Object.freeze({
STRING: "string",
LOWERCASE: "lowercase",
UPPERCASE: "uppercase",
CHAR_CODES: "charCodes",
NUMBER: "number",
INTEGER: "integer",
BIGINT: "bigint",
EMOJINT: "emojint",
URL: "url",
DATE: "date",
COLOR: "color",
USER: "user",
USERS: "users",
MEMBER: "member",
MEMBERS: "members",
RELEVANT: "relevant",
RELEVANTS: "relevants",
CHANNEL: "channel",
CHANNELS: "channels",
TEXT_CHANNEL: "textChannel",
TEXT_CHANNELS: "textChannels",
VOICE_CHANNEL: "voiceChannel",
VOICE_CHANNELS: "voiceChannels",
CATEGORY_CHANNEL: "categoryChannel",
CATEGORY_CHANNELS: "categoryChannels",
NEWS_CHANNEL: "newsChannel",
NEWS_CHANNELS: "newsChannels",
STORE_CHANNEL: "storeChannel",
STORE_CHANNELS: "storeChannels",
STAGE_CHANNEL: "stageChannel",
STAGE_CHANNELS: "stageChannels",
THREAD_CHANNEL: "threadChannel",
THREAD_CHANNELS: "threadChannels",
ROLE: "role",
ROLES: "roles",
EMOJI: "emoji",
EMOJIS: "emojis",
GUILD: "guild",
GUILDS: "guilds",
MESSAGE: "message",
GUILD_MESSAGE: "guildMessage",
RELEVANT_MESSAGE: "relevantMessage",
INVITE: "invite",
USER_MENTION: "userMention",
MEMBER_MENTION: "memberMention",
CHANNEL_MENTION: "channelMention",
ROLE_MENTION: "roleMention",
EMOJI_MENTION: "emojiMention",
COMMAND_ALIAS: "commandAlias",
COMMAND: "command",
INHIBITOR: "inhibitor",
LISTENER: "listener",
TASK: "task",
CONTEXT_MENU_COMMAND: "contextMenuCommand"
});
exports.AkairoHandlerEvents = Object.freeze({
LOAD: "load",
REMOVE: "remove"
});
exports.CommandHandlerEvents = Object.freeze({
COMMAND_BLOCKED: "commandBlocked",
COMMAND_BREAKOUT: "commandBreakout",
COMMAND_CANCELLED: "commandCancelled",
COMMAND_FINISHED: "commandFinished",
COMMAND_INVALID: "commandInvalid",
COMMAND_LOCKED: "commandLocked",
COMMAND_STARTED: "commandStarted",
COOLDOWN: "cooldown",
ERROR: "error",
IN_PROMPT: "inPrompt",
MESSAGE_BLOCKED: "messageBlocked",
MESSAGE_INVALID: "messageInvalid",
MISSING_PERMISSIONS: "missingPermissions",
SLASH_BLOCKED: "slashBlocked",
SLASH_ERROR: "slashError",
SLASH_FINISHED: "slashFinished",
SLASH_MISSING_PERMISSIONS: "slashMissingPermissions",
SLASH_NOT_FOUND: "slashNotFound",
SLASH_STARTED: "slashStarted",
SLASH_ONLY: "slashOnly"
});
exports.ContextCommandHandlerEvents = Object.freeze({
ERROR: "error",
FINISHED: "finished",
NOT_FOUND: "notFound",
STARTED: "started",
BLOCKED: "blocked"
});
exports.BuiltInReasons = Object.freeze({
CLIENT: "client",
BOT: "bot",
OWNER: "owner",
SUPER_USER: "superUser",
GUILD: "guild",
DM: "dm",
AUTHOR_NOT_FOUND: "authorNotFound",
NOT_NSFW: "notNsfw"
});
var ArgumentMatches;
(function (ArgumentMatches) {
ArgumentMatches["PHRASE"] = "phrase";
ArgumentMatches["FLAG"] = "flag";
ArgumentMatches["OPTION"] = "option";
ArgumentMatches["REST"] = "rest";
ArgumentMatches["SEPARATE"] = "separate";
ArgumentMatches["TEXT"] = "text";
ArgumentMatches["CONTENT"] = "content";
ArgumentMatches["REST_CONTENT"] = "restContent";
ArgumentMatches["NONE"] = "none";
})(ArgumentMatches = exports.ArgumentMatches || (exports.ArgumentMatches = {}));
var ArgumentTypes;
(function (ArgumentTypes) {
ArgumentTypes["STRING"] = "string";
ArgumentTypes["LOWERCASE"] = "lowercase";
ArgumentTypes["UPPERCASE"] = "uppercase";
ArgumentTypes["CHAR_CODES"] = "charCodes";
ArgumentTypes["NUMBER"] = "number";
ArgumentTypes["INTEGER"] = "integer";
ArgumentTypes["BIGINT"] = "bigint";
ArgumentTypes["EMOJINT"] = "emojint";
ArgumentTypes["URL"] = "url";
ArgumentTypes["DATE"] = "date";
ArgumentTypes["COLOR"] = "color";
ArgumentTypes["USER"] = "user";
ArgumentTypes["USERS"] = "users";
ArgumentTypes["MEMBER"] = "member";
ArgumentTypes["MEMBERS"] = "members";
ArgumentTypes["RELEVANT"] = "relevant";
ArgumentTypes["RELEVANTS"] = "relevants";
ArgumentTypes["CHANNEL"] = "channel";
ArgumentTypes["CHANNELS"] = "channels";
ArgumentTypes["TEXT_CHANNEL"] = "textChannel";
ArgumentTypes["TEXT_CHANNELS"] = "textChannels";
ArgumentTypes["VOICE_CHANNEL"] = "voiceChannel";
ArgumentTypes["VOICE_CHANNELS"] = "voiceChannels";
ArgumentTypes["CATEGORY_CHANNEL"] = "categoryChannel";
ArgumentTypes["CATEGORY_CHANNELS"] = "categoryChannels";
ArgumentTypes["NEWS_CHANNEL"] = "newsChannel";
ArgumentTypes["NEWS_CHANNELS"] = "newsChannels";
ArgumentTypes["STAGE_CHANNEL"] = "stageChannel";
ArgumentTypes["STAGE_CHANNELS"] = "stageChannels";
ArgumentTypes["THREAD_CHANNEL"] = "threadChannel";
ArgumentTypes["THREAD_CHANNELS"] = "threadChannels";
ArgumentTypes["ROLE"] = "role";
ArgumentTypes["ROLES"] = "roles";
ArgumentTypes["EMOJI"] = "emoji";
ArgumentTypes["EMOJIS"] = "emojis";
ArgumentTypes["GUILD"] = "guild";
ArgumentTypes["GUILDS"] = "guilds";
ArgumentTypes["MESSAGE"] = "message";
ArgumentTypes["GUILD_MESSAGE"] = "guildMessage";
ArgumentTypes["RELEVANT_MESSAGE"] = "relevantMessage";
ArgumentTypes["INVITE"] = "invite";
ArgumentTypes["USER_MENTION"] = "userMention";
ArgumentTypes["MEMBER_MENTION"] = "memberMention";
ArgumentTypes["CHANNEL_MENTION"] = "channelMention";
ArgumentTypes["ROLE_MENTION"] = "roleMention";
ArgumentTypes["EMOJI_MENTION"] = "emojiMention";
ArgumentTypes["COMMAND_ALIAS"] = "commandAlias";
ArgumentTypes["COMMAND"] = "command";
ArgumentTypes["INHIBITOR"] = "inhibitor";
ArgumentTypes["LISTENER"] = "listener";
ArgumentTypes["TASK"] = "task";
ArgumentTypes["CONTEXT_MENU_COMMAND"] = "contextMenuCommand";
})(ArgumentTypes = exports.ArgumentTypes || (exports.ArgumentTypes = {}));
var AkairoHandlerEvents;
(function (AkairoHandlerEvents) {
AkairoHandlerEvents["LOAD"] = "load";
AkairoHandlerEvents["REMOVE"] = "remove";
})(AkairoHandlerEvents = exports.AkairoHandlerEvents || (exports.AkairoHandlerEvents = {}));
var CommandHandlerEvents;
(function (CommandHandlerEvents) {
CommandHandlerEvents["COMMAND_BLOCKED"] = "commandBlocked";
CommandHandlerEvents["COMMAND_BREAKOUT"] = "commandBreakout";
CommandHandlerEvents["COMMAND_CANCELLED"] = "commandCancelled";
CommandHandlerEvents["COMMAND_FINISHED"] = "commandFinished";
CommandHandlerEvents["COMMAND_INVALID"] = "commandInvalid";
CommandHandlerEvents["COMMAND_LOCKED"] = "commandLocked";
CommandHandlerEvents["COMMAND_STARTED"] = "commandStarted";
CommandHandlerEvents["COOLDOWN"] = "cooldown";
CommandHandlerEvents["ERROR"] = "error";
CommandHandlerEvents["IN_PROMPT"] = "inPrompt";
CommandHandlerEvents["MESSAGE_BLOCKED"] = "messageBlocked";
CommandHandlerEvents["MESSAGE_INVALID"] = "messageInvalid";
CommandHandlerEvents["MISSING_PERMISSIONS"] = "missingPermissions";
CommandHandlerEvents["SLASH_BLOCKED"] = "slashBlocked";
CommandHandlerEvents["SLASH_ERROR"] = "slashError";
CommandHandlerEvents["SLASH_FINISHED"] = "slashFinished";
CommandHandlerEvents["SLASH_MISSING_PERMISSIONS"] = "slashMissingPermissions";
CommandHandlerEvents["SLASH_NOT_FOUND"] = "slashNotFound";
CommandHandlerEvents["SLASH_STARTED"] = "slashStarted";
CommandHandlerEvents["SLASH_ONLY"] = "slashOnly";
})(CommandHandlerEvents = exports.CommandHandlerEvents || (exports.CommandHandlerEvents = {}));
var ContextCommandHandlerEvents;
(function (ContextCommandHandlerEvents) {
ContextCommandHandlerEvents["ERROR"] = "error";
ContextCommandHandlerEvents["FINISHED"] = "finished";
ContextCommandHandlerEvents["NOT_FOUND"] = "notFound";
ContextCommandHandlerEvents["STARTED"] = "started";
ContextCommandHandlerEvents["BLOCKED"] = "blocked";
})(ContextCommandHandlerEvents = exports.ContextCommandHandlerEvents || (exports.ContextCommandHandlerEvents = {}));
var BuiltInReasons;
(function (BuiltInReasons) {
BuiltInReasons["CLIENT"] = "client";
BuiltInReasons["BOT"] = "bot";
BuiltInReasons["OWNER"] = "owner";
BuiltInReasons["SUPER_USER"] = "superUser";
BuiltInReasons["GUILD"] = "guild";
BuiltInReasons["DM"] = "dm";
BuiltInReasons["AUTHOR_NOT_FOUND"] = "authorNotFound";
BuiltInReasons["NOT_NSFW"] = "notNsfw";
})(BuiltInReasons = exports.BuiltInReasons || (exports.BuiltInReasons = {}));
//# sourceMappingURL=Constants.js.map

@@ -70,7 +70,2 @@ /// <reference types="node" />

}
/**
* Checks if a value is a string, an array of strings, or a function
* @internal
*/
export declare function isStringArrayStringOrFunc(value: any): value is string | string[] | ((...args: any[]) => any);
export interface DeepEqualsOptions {

@@ -77,0 +72,0 @@ /**

{
"name": "@notenoughupdates/discord-akairo",
"version": "9.1.3-dev.1644799330.8fbaf39",
"version": "9.1.3-dev.1649679866.5536822",
"description": "A highly customizable bot framework for Discord.js.",

@@ -39,35 +39,23 @@ "main": "./dist/src/index.js",

},
"dependencies": {},
"devDependencies": {
"@discordjs/voice": "^0.7.5",
"@favware/npm-deprecate": "^1.0.4",
"@types/node": "^17.0.10",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"copyfiles": "^2.4.1",
"discord-api-types": "^0.26.1",
"discord-api-types": "0.31.0",
"discord.js": "npm:@notenoughupdates/discord.js@dev",
"eslint": "^8.7.0",
"eslint-config-prettier": "^8.3.0",
"eslint": "^8.13.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-deprecation": "^1.3.2",
"node-fetch": "^3.2.0",
"prettier": "^2.5.1",
"node-fetch": "^3.2.3",
"prettier": "^2.6.2",
"rimraf": "^3.0.2",
"typedoc": "^0.22.11",
"typescript": "^4.5.4"
"typedoc": "^0.22.15",
"typescript": "^4.6.3"
},
"prettier": {
"useTabs": true,
"trailingComma": "none",
"arrowParens": "avoid",
"printWidth": 130,
"overrides": [
{
"files": "*.md",
"options": {
"useTabs": false
}
}
]
"packageManager": "yarn@3.1.1",
"dependencies": {
"@sapphire/shapeshift": "^2.0.0"
}
}

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

import { APIEmbed } from "discord-api-types";
import { APIEmbed } from "discord-api-types/v10";
import {

@@ -6,3 +6,4 @@ ActivityType,

Collection,
Embed,
EmbedBuilder,
EmbedData,
Emoji,

@@ -234,4 +235,4 @@ Guild,

*/
public embed(data?: Embed | APIEmbed): Embed {
return new Embed(data);
public embed(data?: EmbedData | APIEmbed): EmbedBuilder {
return new EmbedBuilder(data);
}

@@ -238,0 +239,0 @@

@@ -18,3 +18,2 @@ import type {

StageChannel,
StoreChannel,
TextChannel,

@@ -156,3 +155,3 @@ ThreadChannel,

if (!Object.values(ArgumentMatches).includes(match))
if (!Object.values(ArgumentMatches).includes(match as ArgumentMatches))
throw new TypeError(

@@ -842,3 +841,3 @@ `options.match must one of ${Object.values(ArgumentMatches)

* The command to be run may be the same command or some other command.
* Defaults to true,
* @default true
*/

@@ -853,3 +852,4 @@ breakout?: boolean;

/**
* Word to use for cancelling the command. Defaults to 'cancel'.
* Word to use for cancelling the command.
* @default "cancel"
*/

@@ -867,3 +867,3 @@ cancelWord?: string;

* The final evaluated argument will be an array of the inputs.
* Defaults to false.
* @default false
*/

@@ -873,3 +873,4 @@ infinite?: boolean;

/**
* Amount of inputs allowed for an infinite prompt before finishing. Defaults to Infinity.
* Amount of inputs allowed for an infinite prompt before finishing.
* @default Infinity.
*/

@@ -904,3 +905,4 @@ limit?: number;

/**
* Prompts only when argument is provided but was not of the right type. Defaults to false.
* Prompts only when argument is provided but was not of the right type.
* @default false
*/

@@ -910,3 +912,4 @@ optional?: boolean;

/**
* Amount of retries allowed. Defaults to 1.
* Amount of retries allowed.
* @default 1
*/

@@ -926,3 +929,4 @@ retries?: number;

/**
* Word to use for ending infinite prompts. Defaults to 'stop'.
* Word to use for ending infinite prompts.
* @default "stop"
*/

@@ -932,3 +936,4 @@ stopWord?: string;

/**
* Time to wait for input. Defaults to 30000.
* Time to wait for input.
* @default 30000
*/

@@ -995,3 +1000,2 @@ time?: number;

* - `newsChannel` tries to resolve to a news channel.
* - `storeChannel` tries to resolve to a store channel.
* - `stageChannel` tries to resolve to a stage channel.

@@ -1042,6 +1046,2 @@ * - `threadChannel` tries to resolve a thread channel.

newsChannels: Collection<string, NewsChannel> | null;
// eslint-disable-next-line deprecation/deprecation
storeChannel: StoreChannel | null;
// eslint-disable-next-line deprecation/deprecation
storeChannels: Collection<string, StoreChannel> | null;
stageChannel: StageChannel | null;

@@ -1159,3 +1159,3 @@ stageChannels: Collection<string, StageChannel> | null;

message: Message,
text: string,
text: string | MessagePayload | MessageOptions | OtherwiseContentSupplier,
data: FailureData

@@ -1182,3 +1182,3 @@ ) => string | MessagePayload | MessageOptions | Promise<string | MessagePayload | MessageOptions>;

message: Message,
text: string,
text: string | MessagePayload | MessageOptions | OtherwiseContentSupplier,
data: ArgumentPromptData

@@ -1185,0 +1185,0 @@ ) => string | MessagePayload | MessageOptions | Promise<string | MessagePayload | MessageOptions>;

@@ -9,3 +9,2 @@ import {

StageChannel,
StoreChannel,
TextChannel,

@@ -192,3 +191,3 @@ ThreadChannel,

new Collection([
[(message.channel as DMChannel).recipient.id!, (message.channel as DMChannel).recipient!],
[(message.channel as DMChannel).recipientId, (message.channel as DMChannel).recipient!],
[this.client.user!.id, this.client.user!]

@@ -209,3 +208,3 @@ ])

new Collection([
[(message.channel as DMChannel).recipient.id, (message.channel as DMChannel).recipient],
[(message.channel as DMChannel).recipientId, (message.channel as DMChannel).recipient!],
[this.client.user!.id, this.client.user!]

@@ -307,22 +306,2 @@ ])

[ArgumentTypes.STORE_CHANNEL]: (message, phrase) => {
if (!phrase) return null;
if (!message.inGuild()) return null;
const channel = this.client.util.resolveChannel(phrase, message.guild.channels.cache);
if (!channel || !channel.isStore()) return null;
return channel;
},
[ArgumentTypes.STORE_CHANNELS]: (message, phrase) => {
if (!phrase) return null;
if (!message.inGuild()) return null;
const channels = this.client.util.resolveChannels(phrase, message.guild.channels.cache);
if (!channels.size) return null;
// eslint-disable-next-line deprecation/deprecation
const storeChannels = <Collection<string, StoreChannel>>channels.filter(c => c.isStore());
return storeChannels.size ? storeChannels : null;
},
[ArgumentTypes.STAGE_CHANNEL]: (message, phrase) => {

@@ -343,4 +322,4 @@ if (!phrase) return null;

const storeChannels = <Collection<string, StageChannel>>channels.filter(c => c.isStage());
return storeChannels.size ? storeChannels : null;
const stageChannels = <Collection<string, StageChannel>>channels.filter(c => c.isStage());
return stageChannels.size ? stageChannels : null;
},

@@ -363,4 +342,4 @@

const storeChannels = <Collection<string, ThreadChannel>>channels.filter(c => c.isThread());
return storeChannels.size ? storeChannels : null;
const threadChannels = <Collection<string, ThreadChannel>>channels.filter(c => c.isThread());
return threadChannels.size ? threadChannels : null;
},

@@ -367,0 +346,0 @@

@@ -10,3 +10,2 @@ import {

Awaitable,
ChannelType,
ChatInputCommandInteraction,

@@ -833,3 +832,3 @@ Collection,

const func = `get${originalOption?.resolve ?? AkairoApplicationCommandOptionType[option.type]}` as GetFunction;
const func = `get${originalOption?.resolve ?? ApplicationCommandOptionType[option.type]}` as GetFunction;
if (

@@ -1272,4 +1271,4 @@ !(

}
} else if (message.guild) {
if (message.channel?.type === ChannelType.DM) return false;
} else if (message.inGuild()) {
if (!message.channel || message.channel.isDMBased()) return false;
const missing = message.channel?.permissionsFor(message.guild.me!)?.missing(command.clientPermissions);

@@ -1300,4 +1299,4 @@ if (missing?.length) {

}
} else if (message.guild) {
if (message.channel?.type === ChannelType.DM) return false;
} else if (message.inGuild()) {
if (!message.channel || message.channel.isDMBased()) return false;
const missing = message.channel?.permissionsFor(message.author)?.missing(command.userPermissions);

@@ -1895,24 +1894,5 @@ if (missing?.length) {

// todo: remove this once discord-api-types updates
/**
* Used for reverse mapping since discord exports its enums as const enums.
* @internal
*/
enum AkairoApplicationCommandOptionType {
Subcommand = ApplicationCommandOptionType.Subcommand,
SubcommandGroup = ApplicationCommandOptionType.SubcommandGroup,
String = ApplicationCommandOptionType.String,
Integer = ApplicationCommandOptionType.Integer,
Boolean = ApplicationCommandOptionType.Boolean,
// eslint-disable-next-line @typescript-eslint/no-shadow
User = ApplicationCommandOptionType.User,
Channel = ApplicationCommandOptionType.Channel,
Role = ApplicationCommandOptionType.Role,
Mentionable = ApplicationCommandOptionType.Mentionable,
Number = ApplicationCommandOptionType.Number
}
/**
* @typedef {CommandInteractionOptionResolver} VSCodePleaseStopRemovingMyImports
* @internal
*/
/* eslint-disable require-await */
import { APIMessage } from "discord-api-types/v9";
import { APIMessage } from "discord-api-types/v10";
import {

@@ -120,3 +120,3 @@ Collection,

options: string | WebhookEditMessageOptions | WebhookEditMessageOptions | MessagePayload
): Promise<Message | APIMessage> {
): Promise<APIMessage | Message<boolean>> {
if (!this.isSlashMessage(this.message)) {

@@ -123,0 +123,0 @@ return this.lastResponse!.edit(options);

@@ -6,3 +6,2 @@ /* eslint-disable @typescript-eslint/no-unused-vars */

import type { Category } from "../../util/Category.js";
import type { AkairoClient } from "../AkairoClient.js";
import { AkairoModule, AkairoModuleOptions } from "../AkairoModule.js";

@@ -27,12 +26,2 @@ import type { Command } from "../commands/Command.js";

/**
* The Akairo client.
*/
public declare client: AkairoClient;
/**
* The filepath.
*/
public declare filepath: string;
/**
* The inhibitor handler.

@@ -105,3 +94,2 @@ */

* Options to use for inhibitor execution behavior.
* Also includes properties from AkairoModuleOptions.
*/

@@ -108,0 +96,0 @@ export interface InhibitorOptions extends AkairoModuleOptions {

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

import type { APIInteractionGuildMember, APIMessage } from "discord-api-types/v9";
import type { APIInteractionGuildMember, APIMessage } from "discord-api-types/v10";
import {

@@ -3,0 +3,0 @@ Base,

@@ -1,115 +0,113 @@

export const ArgumentMatches = Object.freeze({
PHRASE: "phrase",
FLAG: "flag",
OPTION: "option",
REST: "rest",
SEPARATE: "separate",
TEXT: "text",
CONTENT: "content",
REST_CONTENT: "restContent",
NONE: "none"
} as const);
export enum ArgumentMatches {
PHRASE = "phrase",
FLAG = "flag",
OPTION = "option",
REST = "rest",
SEPARATE = "separate",
TEXT = "text",
CONTENT = "content",
REST_CONTENT = "restContent",
NONE = "none"
}
export const ArgumentTypes = Object.freeze({
STRING: "string",
LOWERCASE: "lowercase",
UPPERCASE: "uppercase",
CHAR_CODES: "charCodes",
NUMBER: "number",
INTEGER: "integer",
BIGINT: "bigint",
EMOJINT: "emojint",
URL: "url",
DATE: "date",
COLOR: "color",
USER: "user",
USERS: "users",
MEMBER: "member",
MEMBERS: "members",
RELEVANT: "relevant",
RELEVANTS: "relevants",
CHANNEL: "channel",
CHANNELS: "channels",
TEXT_CHANNEL: "textChannel",
TEXT_CHANNELS: "textChannels",
VOICE_CHANNEL: "voiceChannel",
VOICE_CHANNELS: "voiceChannels",
CATEGORY_CHANNEL: "categoryChannel",
CATEGORY_CHANNELS: "categoryChannels",
NEWS_CHANNEL: "newsChannel",
NEWS_CHANNELS: "newsChannels",
STORE_CHANNEL: "storeChannel",
STORE_CHANNELS: "storeChannels",
STAGE_CHANNEL: "stageChannel",
STAGE_CHANNELS: "stageChannels",
THREAD_CHANNEL: "threadChannel",
THREAD_CHANNELS: "threadChannels",
ROLE: "role",
ROLES: "roles",
EMOJI: "emoji",
EMOJIS: "emojis",
GUILD: "guild",
GUILDS: "guilds",
MESSAGE: "message",
GUILD_MESSAGE: "guildMessage",
RELEVANT_MESSAGE: "relevantMessage",
INVITE: "invite",
USER_MENTION: "userMention",
MEMBER_MENTION: "memberMention",
CHANNEL_MENTION: "channelMention",
ROLE_MENTION: "roleMention",
EMOJI_MENTION: "emojiMention",
COMMAND_ALIAS: "commandAlias",
COMMAND: "command",
INHIBITOR: "inhibitor",
LISTENER: "listener",
TASK: "task",
CONTEXT_MENU_COMMAND: "contextMenuCommand"
} as const);
export enum ArgumentTypes {
STRING = "string",
LOWERCASE = "lowercase",
UPPERCASE = "uppercase",
CHAR_CODES = "charCodes",
NUMBER = "number",
INTEGER = "integer",
BIGINT = "bigint",
EMOJINT = "emojint",
URL = "url",
DATE = "date",
COLOR = "color",
USER = "user",
USERS = "users",
MEMBER = "member",
MEMBERS = "members",
RELEVANT = "relevant",
RELEVANTS = "relevants",
CHANNEL = "channel",
CHANNELS = "channels",
TEXT_CHANNEL = "textChannel",
TEXT_CHANNELS = "textChannels",
VOICE_CHANNEL = "voiceChannel",
VOICE_CHANNELS = "voiceChannels",
CATEGORY_CHANNEL = "categoryChannel",
CATEGORY_CHANNELS = "categoryChannels",
NEWS_CHANNEL = "newsChannel",
NEWS_CHANNELS = "newsChannels",
STAGE_CHANNEL = "stageChannel",
STAGE_CHANNELS = "stageChannels",
THREAD_CHANNEL = "threadChannel",
THREAD_CHANNELS = "threadChannels",
ROLE = "role",
ROLES = "roles",
EMOJI = "emoji",
EMOJIS = "emojis",
GUILD = "guild",
GUILDS = "guilds",
MESSAGE = "message",
GUILD_MESSAGE = "guildMessage",
RELEVANT_MESSAGE = "relevantMessage",
INVITE = "invite",
USER_MENTION = "userMention",
MEMBER_MENTION = "memberMention",
CHANNEL_MENTION = "channelMention",
ROLE_MENTION = "roleMention",
EMOJI_MENTION = "emojiMention",
COMMAND_ALIAS = "commandAlias",
COMMAND = "command",
INHIBITOR = "inhibitor",
LISTENER = "listener",
TASK = "task",
CONTEXT_MENU_COMMAND = "contextMenuCommand"
}
export const AkairoHandlerEvents = Object.freeze({
LOAD: "load",
REMOVE: "remove"
} as const);
export enum AkairoHandlerEvents {
LOAD = "load",
REMOVE = "remove"
}
export const CommandHandlerEvents = Object.freeze({
COMMAND_BLOCKED: "commandBlocked",
COMMAND_BREAKOUT: "commandBreakout",
COMMAND_CANCELLED: "commandCancelled",
COMMAND_FINISHED: "commandFinished",
COMMAND_INVALID: "commandInvalid",
COMMAND_LOCKED: "commandLocked",
COMMAND_STARTED: "commandStarted",
COOLDOWN: "cooldown",
ERROR: "error",
IN_PROMPT: "inPrompt",
MESSAGE_BLOCKED: "messageBlocked",
MESSAGE_INVALID: "messageInvalid",
MISSING_PERMISSIONS: "missingPermissions",
SLASH_BLOCKED: "slashBlocked",
SLASH_ERROR: "slashError",
SLASH_FINISHED: "slashFinished",
SLASH_MISSING_PERMISSIONS: "slashMissingPermissions",
SLASH_NOT_FOUND: "slashNotFound",
SLASH_STARTED: "slashStarted",
SLASH_ONLY: "slashOnly"
} as const);
export enum CommandHandlerEvents {
COMMAND_BLOCKED = "commandBlocked",
COMMAND_BREAKOUT = "commandBreakout",
COMMAND_CANCELLED = "commandCancelled",
COMMAND_FINISHED = "commandFinished",
COMMAND_INVALID = "commandInvalid",
COMMAND_LOCKED = "commandLocked",
COMMAND_STARTED = "commandStarted",
COOLDOWN = "cooldown",
ERROR = "error",
IN_PROMPT = "inPrompt",
MESSAGE_BLOCKED = "messageBlocked",
MESSAGE_INVALID = "messageInvalid",
MISSING_PERMISSIONS = "missingPermissions",
SLASH_BLOCKED = "slashBlocked",
SLASH_ERROR = "slashError",
SLASH_FINISHED = "slashFinished",
SLASH_MISSING_PERMISSIONS = "slashMissingPermissions",
SLASH_NOT_FOUND = "slashNotFound",
SLASH_STARTED = "slashStarted",
SLASH_ONLY = "slashOnly"
}
export const ContextCommandHandlerEvents = Object.freeze({
ERROR: "error",
FINISHED: "finished",
NOT_FOUND: "notFound",
STARTED: "started",
BLOCKED: "blocked"
} as const);
export enum ContextCommandHandlerEvents {
ERROR = "error",
FINISHED = "finished",
NOT_FOUND = "notFound",
STARTED = "started",
BLOCKED = "blocked"
}
export const BuiltInReasons = Object.freeze({
CLIENT: "client",
BOT: "bot",
OWNER: "owner",
SUPER_USER: "superUser",
GUILD: "guild",
DM: "dm",
AUTHOR_NOT_FOUND: "authorNotFound",
NOT_NSFW: "notNsfw"
} as const);
export enum BuiltInReasons {
CLIENT = "client",
BOT = "bot",
OWNER = "owner",
SUPER_USER = "superUser",
GUILD = "guild",
DM = "dm",
AUTHOR_NOT_FOUND = "authorNotFound",
NOT_NSFW = "notNsfw"
}
{
"compilerOptions": {
/* Type Checking */
"alwaysStrict": true,
"noImplicitOverride": true,
"strict": true,
"useUnknownInCatchVariables": false,
/* Modules */
"module": "CommonJS",
"target": "ES2021",
"outDir": "dist",
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"noErrorTruncation": true,
"useUnknownInCatchVariables": false,
"alwaysStrict": true,
"strict": true,
"noImplicitOverride": true,
/* Emit */
"declaration": true,
"declarationMap": true,
"declaration": true,
"outDir": "dist",
"sourceMap": true,
"noEmitHelpers": false,
"importHelpers": false
"stripInternal": true,
/* Language and Environment */
"target": "ES2022",
/* Interop Constraints */
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
/* Output Formatting */
"noErrorTruncation": true
},

@@ -20,0 +30,0 @@ "include": ["src/**/*.ts"],

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

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc