Skip to content

Commit

Permalink
types: explicit import
Browse files Browse the repository at this point in the history
  • Loading branch information
twlite committed Nov 25, 2023
1 parent 93ca2ba commit 075ad8e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions packages/commandkit/src/handlers/command-handler/typings.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
import type {
AutocompleteInteraction,
ChatInputCommandInteraction,
Client,
ContextMenuCommandInteraction,
} from 'discord.js';
import { CommandKit } from '../../CommandKit';
import { CommandFileObject } from '../../typings';
import { ValidationHandler } from '../validation-handler/ValidationHandler';
import type { CommandKit } from '../../CommandKit';
import type { CommandFileObject } from '../../typings';
import type { ValidationHandler } from '../validation-handler/ValidationHandler';

/**
* Command handler options.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BuiltInValidationParams } from '../typings';
import type { BuiltInValidationParams } from '../typings';

export default function ({ interaction, targetCommand, handlerData }: BuiltInValidationParams) {
if (interaction.isAutocomplete()) return;
Expand Down
16 changes: 8 additions & 8 deletions packages/commandkit/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
type RESTPostAPIApplicationCommandsJSONBody,
type MessageContextMenuCommandInteraction,
type UserContextMenuCommandInteraction,
type ContextMenuCommandInteraction,
type ChatInputCommandInteraction,
type PermissionsString,
type Client,
import type {
RESTPostAPIApplicationCommandsJSONBody,
MessageContextMenuCommandInteraction,
UserContextMenuCommandInteraction,
ContextMenuCommandInteraction,
ChatInputCommandInteraction,
PermissionsString,
Client,
AutocompleteInteraction,
} from 'discord.js';
import type { CommandKit } from '../CommandKit';
Expand Down
2 changes: 1 addition & 1 deletion packages/commandkit/src/typings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This types file is for development
// For exported types use ./types/index.ts

import type { AutocompleteInteraction, CacheType, Client, Interaction } from 'discord.js';
import type { CacheType, Client, Interaction } from 'discord.js';
import type { CommandData, CommandKit, CommandOptions, ReloadType } from './index';
import type { CommandHandler, EventHandler, ValidationHandler } from './handlers';

Expand Down
2 changes: 1 addition & 1 deletion packages/commandkit/tests/src/validations/devOnly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export default function ({ interaction, commandObj, handler }: ValidationFunctio
if (interaction.isAutocomplete()) return;
if (commandObj.data.name === 'ping') {
interaction.reply('blocked...');
return false;
return true;
}
}

0 comments on commit 075ad8e

Please sign in to comment.