Skip to content

Commit e3239a6

Browse files
committed
Fix types for prefix BaseCommand
1 parent 88c802e commit e3239a6

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

src/commands/prefixed/basecommand.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ export interface ContextMetadata {
2626
}
2727

2828
export class BaseCommand<ParsedArgsFinished = Command.ParsedArgs> extends Command.Command<ParsedArgsFinished> {
29-
/* @ts-ignore */
30-
metadata!: CommandMetadata;
3129
permissionsIgnoreClientOwner = true;
3230
triggerTypingAfter = 2000;
3331

@@ -42,8 +40,9 @@ export class BaseCommand<ParsedArgsFinished = Command.ParsedArgs> extends Comman
4240
}
4341

4442
get commandDescription(): string {
45-
if (typeof(this.metadata.usage) === 'string') {
46-
return `${this.fullName} ${this.metadata.usage}`.trim();
43+
const metadata = this.metadata as CommandMetadata;
44+
if (typeof(metadata.usage) === 'string') {
45+
return `${this.fullName} ${metadata.usage}`.trim();
4746
}
4847
return '';
4948
}

src/commands/prefixed/utils/help.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Markup } from 'detritus-client/lib/utils';
55
import { CommandTypes, EmbedBrands, EmbedColors } from '../../../constants';
66
import { Paginator, createUserEmbed, editOrReply, toTitleCase } from '../../../utils';
77

8-
import { BaseCommand } from '../basecommand';
8+
import { BaseCommand, CommandMetadata } from '../basecommand';
99

1010

1111
export interface CommandArgsBefore {
@@ -16,14 +16,6 @@ export interface CommandArgs {
1616
commands: Array<Command.Command>,
1717
}
1818

19-
export interface CommandMetadata {
20-
description: string,
21-
examples?: Array<string>,
22-
nsfw?: boolean,
23-
type: CommandTypes,
24-
usage: string,
25-
}
26-
2719

2820
export const COMMAND_NAME = 'help';
2921

@@ -126,7 +118,7 @@ export default class HelpCommand extends BaseCommand {
126118

127119
embed.setColor(EmbedColors.DEFAULT);
128120
embed.setTitle(name);
129-
embed.setDescription(metadata.description);
121+
embed.setDescription(metadata.description || '');
130122

131123
if (names.length) {
132124
embed.addField('Aliases', names.join('\n'), true);

src/stores/guildsettings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class GuildSettingsStore extends Store<string, GuildSettings> {
4444
} else {
4545
const timeout = new Timers.Timeout();
4646
promise = new Promise(async (resolve) => {
47-
timeout.start(5000, () => {
47+
timeout.start(15000, () => {
4848
GuildSettingsPromisesStore.delete(guildId);
4949
resolve(null);
5050
});

0 commit comments

Comments
 (0)