Skip to content

Commit

Permalink
feat(commands): more types for detailed description (#372)
Browse files Browse the repository at this point in the history
This backports 5f3fea4
  • Loading branch information
favna committed Feb 5, 2022
1 parent 3b35c91 commit 5085644
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, PieceContext } from '@sapphire/pieces';
import { Awaitable, isNullish } from '@sapphire/utilities';
import { Awaitable, isNullish, NonNullObject } from '@sapphire/utilities';
import { Message, PermissionResolvable, Permissions, Snowflake } from 'discord.js';
import * as Lexure from 'lexure';
import { Args } from '../parsers/Args';
Expand All @@ -24,7 +24,7 @@ export abstract class Command<T = Args, O extends Command.Options = Command.Opti
* 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 @@ -408,7 +408,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 @@ -530,7 +530,7 @@ export interface CommandContext extends Record<PropertyKey, unknown> {

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

Expand All @@ -541,3 +541,7 @@ export namespace Command {
export type RunContext = CommandContext;
export type RunInTypes = CommandOptionsRunType;
}

export type DetailedDescriptionCommand = string | DetailedDescriptionCommandObject;

export interface DetailedDescriptionCommandObject extends NonNullObject {}

0 comments on commit 5085644

Please sign in to comment.