Skip to content

Commit

Permalink
10.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
IRONM00N committed Apr 3, 2023
1 parent f608444 commit 1d4e018
Show file tree
Hide file tree
Showing 6 changed files with 1,466 additions and 641 deletions.
39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@notenoughupdates/discord-akairo",
"version": "10.0.2-dev",
"version": "10.0.2",
"description": "A highly customizable bot framework for Discord.js.",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
Expand Down Expand Up @@ -46,29 +46,30 @@
"prepublishOnly": "yarn test:all && yarn build:no-emit"
},
"dependencies": {
"zod": "^3.19.1"
"zod": "^3.21.4"
},
"devDependencies": {
"@favware/npm-deprecate": "^1.0.5",
"@types/node": "^18.8.3",
"@typescript-eslint/eslint-plugin": "^5.39.0",
"@typescript-eslint/parser": "^5.39.0",
"@favware/npm-deprecate": "^1.0.7",
"@types/node": "^18.15.11",
"@typescript-eslint/eslint-plugin": "^5.57.1",
"@typescript-eslint/parser": "^5.57.1",
"cp-cli": "^2.0.0",
"discord.js": "^14.5.0",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-deprecation": "^1.3.2",
"eslint-plugin-import": "^2.26.0",
"node-fetch": "^3.2.10",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"ts-essentials": "^9.3.0",
"typedoc": "^0.23.15",
"typescript": "^4.8.4",
"vitest": "^0.24.0"
"discord.js": "^14.9.0",
"eslint": "^8.37.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-deprecation": "^1.4.0",
"eslint-plugin-import": "^2.27.5",
"node-fetch": "^3.3.1",
"prettier": "^2.8.7",
"rimraf": "^4.4.1",
"ts-essentials": "^9.3.1",
"typedoc": "^0.23.28",
"typescript": "^5.0.3",
"vitest": "^0.29.8"
},
"resolutions": {
"@sapphire/shapeshift": "^3.7.0"
"@sapphire/shapeshift": "^3.7.0",
"discord.js": "npm:@notenoughupdates/discord.js@dev"
},
"packageManager": "yarn@3.2.2"
}
2 changes: 1 addition & 1 deletion src/struct/commands/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ type GetNonSub<T> = T extends Sub ? never : T & SlashExt;
export type SlashNonSub = GetNonSub<ApplicationCommandOptionData>;

export interface ExtGroup extends ApplicationCommandSubGroupData {
options?: ExtSub[];
options: ExtSub[];
}

export interface ExtSub extends ApplicationCommandSubCommandData {
Expand Down
14 changes: 12 additions & 2 deletions src/struct/commands/CommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,11 @@ export class CommandHandler extends AkairoHandler<Command, CommandHandler> {
return {
name: interaction.name,
description: interaction.type === ApplicationCommandType.ChatInput ? interaction.description ?? "" : undefined!,
options: interaction.type === ApplicationCommandType.ChatInput ? interaction.options ?? [] : undefined,
options:
interaction.type === ApplicationCommandType.ChatInput
? // todo: check if this is okay
(interaction.options as ApplicationCommandOptionData[]) ?? []
: undefined,
defaultMemberPermissions: interaction.defaultMemberPermissions,
dmPermission: interaction.dmPermission!,
type: interaction.type,
Expand Down Expand Up @@ -686,7 +690,13 @@ export class CommandHandler extends AkairoHandler<Command, CommandHandler> {
: (ApplicationCommandOptionType[option.type] as SlashResolveType)
}` as const;

convertedOptions[option.name] = interaction.options[func](option.name, false);
// getMember and getChannel have incompatible signatures with the others
convertedOptions[option.name] =
func === "getMember"
? interaction.options.getMember(option.name)
: func === "getChannel"
? interaction.options.getChannel(option.name, false)
: interaction.options[func](option.name, false);
}

// Makes options that are not found to be null so that it matches the behavior normal commands.
Expand Down
8 changes: 4 additions & 4 deletions src/struct/commands/CommandUtil.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {
Collection,
MessagePayload,
type InteractionEditReplyOptions,
type InteractionReplyOptions,
type Message,
type MessageCreateOptions,
type MessageEditOptions,
type MessageReplyOptions,
type Snowflake,
type WebhookEditMessageOptions
type Snowflake
} from "discord.js";
import { AkairoMessage } from "../../util/AkairoMessage.js";
import type { ContextMenuCommandHandler } from "../contextMenuCommands/ContextMenuCommandHandler.js";
Expand Down Expand Up @@ -112,8 +112,8 @@ export class CommandUtil<MessageType extends AkairoMessage | Message> {
* @param options - Options to use.
*/
public async edit(options: string | MessageEditOptions | MessagePayload): Promise<Message>;
public async edit(options: string | WebhookEditMessageOptions | MessagePayload): Promise<Message>;
public async edit(options: string | WebhookEditMessageOptions | WebhookEditMessageOptions | MessagePayload): Promise<Message> {
public async edit(options: string | InteractionEditReplyOptions | MessagePayload): Promise<Message>;
public async edit(options: string | InteractionEditReplyOptions | MessageEditOptions | MessagePayload): Promise<Message> {
if (!this.isSlashMessage(this.message)) {
return await this.lastResponse!.edit(options);
} else {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/* Emit */
"declaration": true,
"declarationMap": true,
"importsNotUsedAsValues": "preserve",
// "importsNotUsedAsValues": "preserve",
"newLine": "lf",
"noEmitOnError": true,
"preserveConstEnums": true,
Expand Down
Loading

0 comments on commit 1d4e018

Please sign in to comment.