Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
fix(Command): fix ApplicationCommand type with @discordjs/builders
Browse files Browse the repository at this point in the history
  • Loading branch information
Hazmi35 authored May 5, 2024
1 parent 7a3947f commit cc73cad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/framework/src/Stores/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Lexer, PrefixedStrategy } from "@sapphire/lexure";
import type { AliasPieceOptions, LoaderPieceContext } from "@sapphire/pieces";
import { AliasPiece } from "@sapphire/pieces";
import type { Awaitable } from "@sapphire/utilities";
import type { APIApplicationCommandOption } from "discord-api-types/v10";
import type { APIApplicationCommandOption, RESTPostAPIApplicationCommandsJSONBody } from "discord-api-types/v10";
import { PermissionFlagsBits } from "discord-api-types/v10";
import type { CommandContext } from "../Lib/CommandContext.js";
import type { FlagStrategyOptions } from "../Lib/FlagUnorderedStrategy.js";
Expand Down Expand Up @@ -94,8 +94,8 @@ export type CommandOptions = AliasPieceOptions & FlagStrategyOptions & {
quotes?: [string, string][];
strategy?: IUnorderedStrategy;
preconditions?: PreconditionEntryResolvable[];
chatInput?: APIApplicationCommandOption;
contextMenu?: APIApplicationCommandOption;
chatInput?: APIApplicationCommandOption | RESTPostAPIApplicationCommandsJSONBody;
contextMenu?: APIApplicationCommandOption | RESTPostAPIApplicationCommandsJSONBody;
meta?: CommandMeta;
clientPermissions?: {
voice?: bigint[];
Expand Down
4 changes: 2 additions & 2 deletions packages/framework/src/Stores/CommandStore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AliasStore } from "@sapphire/pieces";
import type { APIApplicationCommandOption } from "discord-api-types/v10";
import type { APIApplicationCommandOption, RESTPostAPIApplicationCommandsJSONBody } from "discord-api-types/v10";
import { Routes } from "discord-api-types/v10.js";
import { Events } from "../Utilities/EventEnums.js";
import { Command } from "./Command.js";
Expand All @@ -11,7 +11,7 @@ export class CommandStore extends AliasStore<Command> {

public async postCommands(): Promise<void> {
const commands = [...this.values()];
const registerAbleCommands: APIApplicationCommandOption[] = [];
const registerAbleCommands: (APIApplicationCommandOption | RESTPostAPIApplicationCommandsJSONBody)[] = [];

for (const command of commands) {
if (command.options.chatInput) {
Expand Down

0 comments on commit cc73cad

Please sign in to comment.