Refactor and update types and handlers

- README changes: removed 'as const' annotation and note.
- Connector changes: dispatched event for commands in gateway.
- Updated processor type guard for command handlers.
- Removed readonly from CommandHandler types in handler definitions.
- Test adjustments: updated demo tests to reliable command registration.
This commit is contained in:
2025-01-12 15:36:01 -06:00
parent 8943b5a06e
commit e6e4fd1a02
5 changed files with 18 additions and 18 deletions
+1 -1
View File
@@ -180,7 +180,7 @@ export class Processor {
has: (event: string) => this.handlers[HandlerType.Interactions].has(event) ?? this.handlers[HandlerType.Interactions].get(event)?.length! > 0
};
static isCommandHandler = (handler: Handler): handler is CommandHandler<readonly ApplicationCommandOption[]> => {
static isCommandHandler = (handler: Handler): handler is CommandHandler<ApplicationCommandOption[]> => {
if (typeof handler === 'object') {
return 'args' in handler && Trait.execute in handler && handler instanceof CommandHandler;
} else {