mirror of
https://github.com/jaronpate/unicord.git
synced 2026-10-18 21:47:40 +00:00
some comments and console.log cleanup
This commit is contained in:
@@ -104,6 +104,7 @@ export class UnicordCommandManager {
|
|||||||
return Promise.resolve(validated as ArgumentTypeFromOptions<Options['args']>);
|
return Promise.resolve(validated as ArgumentTypeFromOptions<Options['args']>);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// TODO: Register application commands with the DiscordAPI
|
||||||
register<const Options extends UnicordCommandOptions>(
|
register<const Options extends UnicordCommandOptions>(
|
||||||
type: UnicordEventType.ChatCommands | UnicordEventType.ApplicationCommands,
|
type: UnicordEventType.ChatCommands | UnicordEventType.ApplicationCommands,
|
||||||
event: string,
|
event: string,
|
||||||
@@ -118,11 +119,7 @@ export class UnicordCommandManager {
|
|||||||
|
|
||||||
// Generate a closure to wrap the handler
|
// Generate a closure to wrap the handler
|
||||||
const wrappedHandler = (async (context: UnicordCommandContext, args: any[]) => {
|
const wrappedHandler = (async (context: UnicordCommandContext, args: any[]) => {
|
||||||
console.log('Raw Args:', args);
|
|
||||||
console.log('options:', options.args);
|
|
||||||
const resolvedArgs = await this.validateAndResolveArgs<Options>(args, options.args);
|
const resolvedArgs = await this.validateAndResolveArgs<Options>(args, options.args);
|
||||||
console.log('Resolved Args:', resolvedArgs);
|
|
||||||
// TODO: Fix context type here
|
|
||||||
return handler(context, resolvedArgs);
|
return handler(context, resolvedArgs);
|
||||||
}) as UnicordCommandHandler<Options>;
|
}) as UnicordCommandHandler<Options>;
|
||||||
|
|
||||||
|
|||||||
@@ -28,11 +28,6 @@ export class Unicord {
|
|||||||
readonly discordAPI: UnicordDiscordAPI;
|
readonly discordAPI: UnicordDiscordAPI;
|
||||||
private readonly eventProcessor: UnicordEventProcessor;
|
private readonly eventProcessor: UnicordEventProcessor;
|
||||||
private readonly gatewayManager: UnicordGatewayManager;
|
private readonly gatewayManager: UnicordGatewayManager;
|
||||||
// TODO: split command management out of the event processor
|
|
||||||
// This way we can properly store and manage registered commands
|
|
||||||
// This will enable features like command listing, removal, autogenerated help, etc.
|
|
||||||
// We can also go registration with the Discord API here
|
|
||||||
// This will also eliminate the weird helper methods on the Unicord class itself
|
|
||||||
private readonly commandManager: UnicordCommandManager;
|
private readonly commandManager: UnicordCommandManager;
|
||||||
readonly caches: {
|
readonly caches: {
|
||||||
readonly users: UnicordUsersCache;
|
readonly users: UnicordUsersCache;
|
||||||
|
|||||||
Reference in New Issue
Block a user