Skip to content

Commit

Permalink
feat(commands): more types for detailed description (#372)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeroen Claassens <[email protected]>
  • Loading branch information
sawa-ko and favna authored Feb 5, 2022
1 parent 168769c commit 5f3fea4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/lib/structures/Command.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AliasPiece, AliasPieceJSON, AliasStore, PieceContext } from '@sapphire/pieces';
import { Awaitable, isNullish } from '@sapphire/utilities';
import { Awaitable, isNullish, NonNullObject } from '@sapphire/utilities';
import {
AutocompleteInteraction,
CommandInteraction,
Expand Down Expand Up @@ -35,7 +35,7 @@ export class Command<PreParseReturn = Args, O extends Command.Options = Command.
* Longer version of command's summary and how to use it
* @since 1.0.0
*/
public detailedDescription: string;
public detailedDescription: DetailedDescriptionCommand;

/**
* The full category for the command. Either an array of strings that denote every (sub)folder the command is in,
Expand Down Expand Up @@ -582,7 +582,7 @@ export interface CommandOptions extends AliasPiece.Options, FlagStrategyOptions
* @since 1.0.0
* @default ''
*/
detailedDescription?: string;
detailedDescription?: DetailedDescriptionCommand;

/**
* The full category path for the command
Expand Down Expand Up @@ -790,7 +790,7 @@ export interface AutocompleteCommandContext extends Record<PropertyKey, unknown>

export interface CommandJSON extends AliasPieceJSON {
description: string;
detailedDescription: string;
detailedDescription: DetailedDescriptionCommand;
category: string | null;
}

Expand All @@ -800,3 +800,7 @@ export namespace Command {
export type Context = AliasPiece.Context;
export type RunInTypes = CommandOptionsRunType;
}

export type DetailedDescriptionCommand = string | DetailedDescriptionCommandObject;

export interface DetailedDescriptionCommandObject extends NonNullObject {}

0 comments on commit 5f3fea4

Please sign in to comment.