|
1 | 1 | import { ArgumentStream, Lexer, Parser, type IUnorderedStrategy } from '@sapphire/lexure';
|
2 | 2 | import { AliasPiece } from '@sapphire/pieces';
|
3 |
| -import { isNullish, isObject, type Awaitable } from '@sapphire/utilities'; |
| 3 | +import { isFunction, isNullish, isObject, type Awaitable } from '@sapphire/utilities'; |
4 | 4 | import { ChannelType, ChatInputCommandInteraction, ContextMenuCommandInteraction, type AutocompleteInteraction, type Message } from 'discord.js';
|
5 | 5 | import { Args } from '../parsers/Args';
|
6 | 6 | import {
|
@@ -239,28 +239,28 @@ export class Command<PreParseReturn = Args, Options extends Command.Options = Co
|
239 | 239 | * Type-guard that ensures the command supports message commands by checking if the handler for it is present
|
240 | 240 | */
|
241 | 241 | public supportsMessageCommands(): this is MessageCommand {
|
242 |
| - return Reflect.has(this, 'messageRun'); |
| 242 | + return isFunction(Reflect.get(this, 'messageRun')); |
243 | 243 | }
|
244 | 244 |
|
245 | 245 | /**
|
246 | 246 | * Type-guard that ensures the command supports chat input commands by checking if the handler for it is present
|
247 | 247 | */
|
248 | 248 | public supportsChatInputCommands(): this is ChatInputCommand {
|
249 |
| - return Reflect.has(this, 'chatInputRun'); |
| 249 | + return isFunction(Reflect.get(this, 'chatInputRun')); |
250 | 250 | }
|
251 | 251 |
|
252 | 252 | /**
|
253 | 253 | * Type-guard that ensures the command supports context menu commands by checking if the handler for it is present
|
254 | 254 | */
|
255 | 255 | public supportsContextMenuCommands(): this is ContextMenuCommand {
|
256 |
| - return Reflect.has(this, 'contextMenuRun'); |
| 256 | + return isFunction(Reflect.get(this, 'contextMenuRun')); |
257 | 257 | }
|
258 | 258 |
|
259 | 259 | /**
|
260 | 260 | * Type-guard that ensures the command supports handling autocomplete interactions by checking if the handler for it is present
|
261 | 261 | */
|
262 | 262 | public supportsAutocompleteInteractions(): this is AutocompleteCommand {
|
263 |
| - return Reflect.has(this, 'autocompleteRun'); |
| 263 | + return isFunction(Reflect.get(this, 'autocompleteRun')); |
264 | 264 | }
|
265 | 265 |
|
266 | 266 | public override async reload() {
|
|
0 commit comments