@notenoughupdates/discord-akairo
Advanced tools
Comparing version 10.0.0-dev.1663615008.878749e to 10.0.0-dev.1664158089.48d6368
{ | ||
"name": "@notenoughupdates/discord-akairo", | ||
"version": "10.0.0-dev.1663615008.878749e", | ||
"version": "10.0.0-dev.1664158089.48d6368", | ||
"description": "A highly customizable bot framework for Discord.js.", | ||
@@ -29,8 +29,8 @@ "main": "./dist/src/index.js", | ||
"type": "git", | ||
"url": "https://github.com/NotEnoughUpdates/discord-akairo" | ||
"url": "https://github.com/TanzaniteBot/discord-akairo" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/NotEnoughUpdates/discord-akairo/issues" | ||
"url": "https://github.com/TanzaniteBot/discord-akairo/issues" | ||
}, | ||
"homepage": "https://github.com/NotEnoughUpdates/discord-akairo/wiki", | ||
"homepage": "https://github.com/TanzaniteBot/discord-akairo/wiki", | ||
"scripts": { | ||
@@ -49,10 +49,13 @@ "lint": "yarn eslint ./src", | ||
}, | ||
"dependencies": { | ||
"zod": "^3.19.1" | ||
}, | ||
"devDependencies": { | ||
"@favware/npm-deprecate": "^1.0.5", | ||
"@types/node": "^18.7.18", | ||
"@typescript-eslint/eslint-plugin": "^5.37.0", | ||
"@typescript-eslint/parser": "^5.37.0", | ||
"@types/node": "^18.7.21", | ||
"@typescript-eslint/eslint-plugin": "^5.38.0", | ||
"@typescript-eslint/parser": "^5.38.0", | ||
"cp-cli": "^2.0.0", | ||
"discord.js": "^14.3.0", | ||
"eslint": "^8.23.1", | ||
"discord.js": "^14.5.0", | ||
"eslint": "^8.24.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
@@ -65,13 +68,10 @@ "eslint-plugin-deprecation": "^1.3.2", | ||
"ts-essentials": "^9.3.0", | ||
"typedoc": "^0.23.14", | ||
"typedoc": "^0.23.15", | ||
"typescript": "^4.8.3", | ||
"vitest": "^0.23.2" | ||
"vitest": "^0.23.4" | ||
}, | ||
"packageManager": "yarn@3.2.2", | ||
"dependencies": { | ||
"zod": "^3.19.1" | ||
}, | ||
"resolutions": { | ||
"@sapphire/shapeshift": "^3.6.0" | ||
} | ||
}, | ||
"packageManager": "yarn@3.2.2" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { Collection, MessagePayload, type InteractionReplyOptions, type Message, type MessageEditOptions, type MessageOptions, type ReplyMessageOptions, type Snowflake, type WebhookEditMessageOptions } from "discord.js"; | ||
import { Collection, MessagePayload, type InteractionReplyOptions, type Message, type MessageCreateOptions, type MessageEditOptions, type MessageReplyOptions, type Snowflake, type WebhookEditMessageOptions } from "discord.js"; | ||
import { AkairoMessage } from "../../util/AkairoMessage.js"; | ||
@@ -21,7 +21,7 @@ import type { ContextMenuCommandHandler } from "../contextMenuCommands/ContextMenuCommandHandler.js"; | ||
edit(options: string | WebhookEditMessageOptions | MessagePayload): Promise<Message>; | ||
reply(options: string | MessagePayload | ReplyMessageOptions): Promise<Message>; | ||
reply(options: string | MessagePayload | MessageReplyOptions): Promise<Message>; | ||
reply(options: string | MessagePayload | InteractionReplyOptions): Promise<Message>; | ||
send(options: string | MessagePayload | MessageOptions): Promise<Message>; | ||
send(options: string | MessagePayload | MessageCreateOptions): Promise<Message>; | ||
send(options: string | MessagePayload | InteractionReplyOptions): Promise<Message>; | ||
sendNew(options: string | MessagePayload | MessageOptions): Promise<Message>; | ||
sendNew(options: string | MessagePayload | MessageCreateOptions): Promise<Message>; | ||
sendNew(options: string | MessagePayload | InteractionReplyOptions): Promise<Message>; | ||
@@ -28,0 +28,0 @@ setEditable(state: boolean): CommandUtil<MessageType>; |
@@ -1,4 +0,4 @@ | ||
import { Message, MessagePayload, PermissionResolvable, type MessageOptions } from "discord.js"; | ||
import { Message, MessagePayload, PermissionResolvable, type MessageCreateOptions } from "discord.js"; | ||
import { z } from "zod"; | ||
export declare type MessageSendResolvable = string | MessagePayload | MessageOptions; | ||
export declare type MessageSendResolvable = string | MessagePayload | MessageCreateOptions; | ||
export declare const MessageSendResolvable: z.ZodUnion<[z.ZodString, z.ZodType<MessagePayload, z.ZodTypeDef, MessagePayload>, z.ZodRecord<z.ZodString, z.ZodAny>]>; | ||
@@ -5,0 +5,0 @@ export declare type SyncOrAsync<T> = T | Promise<T>; |
@@ -16,3 +16,3 @@ import { Base, type CacheType, type ChatInputCommandInteraction, type InteractionReplyOptions, type Message, type MessagePayload } from "discord.js"; | ||
util: CommandUtil<AkairoMessage>; | ||
constructor(client: AkairoClient, interaction: ChatInputCommandInteraction<Cached>); | ||
constructor(client: AkairoClient<true>, interaction: ChatInputCommandInteraction<Cached>); | ||
get channel(): ChatInputCommandInteraction<Cached>["channel"]; | ||
@@ -19,0 +19,0 @@ get cleanContent(): string | null; |
{ | ||
"name": "@notenoughupdates/discord-akairo", | ||
"version": "10.0.0-dev.1663615008.878749e", | ||
"version": "10.0.0-dev.1664158089.48d6368", | ||
"description": "A highly customizable bot framework for Discord.js.", | ||
@@ -29,8 +29,8 @@ "main": "./dist/src/index.js", | ||
"type": "git", | ||
"url": "https://github.com/NotEnoughUpdates/discord-akairo" | ||
"url": "https://github.com/TanzaniteBot/discord-akairo" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/NotEnoughUpdates/discord-akairo/issues" | ||
"url": "https://github.com/TanzaniteBot/discord-akairo/issues" | ||
}, | ||
"homepage": "https://github.com/NotEnoughUpdates/discord-akairo/wiki", | ||
"homepage": "https://github.com/TanzaniteBot/discord-akairo/wiki", | ||
"scripts": { | ||
@@ -49,10 +49,13 @@ "lint": "yarn eslint ./src", | ||
}, | ||
"dependencies": { | ||
"zod": "^3.19.1" | ||
}, | ||
"devDependencies": { | ||
"@favware/npm-deprecate": "^1.0.5", | ||
"@types/node": "^18.7.18", | ||
"@typescript-eslint/eslint-plugin": "^5.37.0", | ||
"@typescript-eslint/parser": "^5.37.0", | ||
"@types/node": "^18.7.21", | ||
"@typescript-eslint/eslint-plugin": "^5.38.0", | ||
"@typescript-eslint/parser": "^5.38.0", | ||
"cp-cli": "^2.0.0", | ||
"discord.js": "^14.3.0", | ||
"eslint": "^8.23.1", | ||
"discord.js": "^14.5.0", | ||
"eslint": "^8.24.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
@@ -65,13 +68,10 @@ "eslint-plugin-deprecation": "^1.3.2", | ||
"ts-essentials": "^9.3.0", | ||
"typedoc": "^0.23.14", | ||
"typedoc": "^0.23.15", | ||
"typescript": "^4.8.3", | ||
"vitest": "^0.23.2" | ||
"vitest": "^0.23.4" | ||
}, | ||
"packageManager": "yarn@3.2.2", | ||
"dependencies": { | ||
"zod": "^3.19.1" | ||
}, | ||
"resolutions": { | ||
"@sapphire/shapeshift": "^3.6.0" | ||
} | ||
}, | ||
"packageManager": "yarn@3.2.2" | ||
} |
@@ -6,5 +6,5 @@ import { | ||
type Message, | ||
type MessageCreateOptions, | ||
type MessageEditOptions, | ||
type MessageOptions, | ||
type ReplyMessageOptions, | ||
type MessageReplyOptions, | ||
type Snowflake, | ||
@@ -130,9 +130,9 @@ type WebhookEditMessageOptions | ||
*/ | ||
public async reply(options: string | MessagePayload | ReplyMessageOptions): Promise<Message>; | ||
public async reply(options: string | MessagePayload | MessageReplyOptions): Promise<Message>; | ||
public async reply(options: string | MessagePayload | InteractionReplyOptions): Promise<Message>; | ||
public async reply(options: string | MessagePayload | ReplyMessageOptions | InteractionReplyOptions): Promise<Message> { | ||
const newOptions = (typeof options === "string" ? { content: options } : options) as ReplyMessageOptions; | ||
public async reply(options: string | MessagePayload | MessageReplyOptions | InteractionReplyOptions): Promise<Message> { | ||
const newOptions = (typeof options === "string" ? { content: options } : options) as MessageReplyOptions; | ||
if (!this.isSlashMessage(this.message) && !this.shouldEdit && !(newOptions instanceof MessagePayload) && !this.deleted) { | ||
(newOptions as MessageOptions).reply = { | ||
(newOptions as MessageCreateOptions).reply = { | ||
messageReference: this.message, | ||
@@ -149,5 +149,5 @@ failIfNotExists: newOptions.failIfNotExists ?? this.handler.client.options.failIfNotExists | ||
*/ | ||
public async send(options: string | MessagePayload | MessageOptions): Promise<Message>; | ||
public async send(options: string | MessagePayload | MessageCreateOptions): Promise<Message>; | ||
public async send(options: string | MessagePayload | InteractionReplyOptions): Promise<Message>; | ||
public async send(options: string | MessagePayload | MessageOptions | InteractionReplyOptions): Promise<Message> { | ||
public async send(options: string | MessagePayload | MessageCreateOptions | InteractionReplyOptions): Promise<Message> { | ||
const hasFiles = typeof options === "string" || !options.files?.length ? false : options.files.length > 0; | ||
@@ -165,3 +165,3 @@ const newOptions = typeof options === "string" ? { content: options } : options; | ||
} | ||
const sent = await this.message.channel?.send(newOptions as MessageOptions); | ||
const sent = await this.message.channel?.send(newOptions as MessageCreateOptions); | ||
@@ -173,3 +173,3 @@ const lastSent = this.setLastResponse(sent!); | ||
} else { | ||
(newOptions as MessageOptions).reply = undefined; | ||
(newOptions as MessageCreateOptions).reply = undefined; | ||
if (this.lastResponse || this.message.interaction.deferred || this.message.interaction.replied) { | ||
@@ -192,7 +192,7 @@ this.lastResponse = (await this.message.interaction.editReply(newOptions)) as Message; | ||
*/ | ||
public async sendNew(options: string | MessagePayload | MessageOptions): Promise<Message>; | ||
public async sendNew(options: string | MessagePayload | MessageCreateOptions): Promise<Message>; | ||
public async sendNew(options: string | MessagePayload | InteractionReplyOptions): Promise<Message>; | ||
public async sendNew(options: string | MessagePayload | MessageOptions | InteractionReplyOptions): Promise<Message> { | ||
public async sendNew(options: string | MessagePayload | MessageCreateOptions | InteractionReplyOptions): Promise<Message> { | ||
if (!this.isSlashMessage(this.message)) { | ||
const sent = await this.message.channel?.send(options as string | MessagePayload | MessageOptions); | ||
const sent = await this.message.channel?.send(options as string | MessagePayload | MessageCreateOptions); | ||
const lastSent = this.setLastResponse(sent!); | ||
@@ -199,0 +199,0 @@ this.setEditable(!lastSent.attachments.size); |
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { BitField, Message, MessagePayload, PermissionFlagsBits, PermissionResolvable, type MessageOptions } from "discord.js"; | ||
import { | ||
BitField, | ||
Message, | ||
MessagePayload, | ||
PermissionFlagsBits, | ||
PermissionResolvable, | ||
type MessageCreateOptions | ||
} from "discord.js"; | ||
import { z, ZodLiteral, ZodType, ZodUnion, type ZodTypeAny } from "zod"; | ||
export type MessageSendResolvable = string | MessagePayload | MessageOptions; | ||
export type MessageSendResolvable = string | MessagePayload | MessageCreateOptions; | ||
export const MessageSendResolvable = z.union([z.string(), z.instanceof(MessagePayload), z.record(z.any())]); | ||
@@ -7,0 +14,0 @@ |
@@ -77,3 +77,3 @@ import { | ||
*/ | ||
public constructor(client: AkairoClient, interaction: ChatInputCommandInteraction<Cached>) { | ||
public constructor(client: AkairoClient<true>, interaction: ChatInputCommandInteraction<Cached>) { | ||
super(client); | ||
@@ -80,0 +80,0 @@ |
Sorry, the diff of this file is too big to display
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
1080734
17169