Skip to content

Commit

Permalink
fix: add check for subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
SocketSomeone committed Jun 5, 2022
1 parent 05b8079 commit 7b3a07a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/slash-commands/slash-command.discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ export class SlashCommandGroupDiscovery extends CommandDiscovery {
return this.reflector.get(MEMBER_PERMISSIONS_METADATA, this.getClass());
}

public isSlashCommand(): this is SlashCommandDiscovery {
return true;
}

public override toJSON(): Record<string, any> {
return {
...this.meta,
Expand All @@ -117,6 +121,10 @@ export interface SlashCommandSubGroupDiscovery

@mix(MethodDiscoveryMixin)
export class SlashCommandSubGroupDiscovery extends BaseDiscovery {
public isSlashCommand(): this is SlashCommandDiscovery {
return true;
}

public override toJSON(): Record<string, any> {
return this.meta;
}
Expand Down

0 comments on commit 7b3a07a

Please sign in to comment.