Prototyping application commands & base command handler

This commit is contained in:
2024-11-16 11:55:10 -06:00
parent f3b1546d54
commit 119ddfefd1
6 changed files with 236 additions and 17 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ import { Processor } from './processor';
import { Expectation, fromDiscord, Intent, type ClientConfig } from '../types/common';
import { exists, isNil } from '../utils/index';
import type { Handler } from '../types/hander';
import { DiscordMessage, Message } from '../types/message';
import { type DiscordMessage, Message } from '../types/message';
import { Guilds } from './caches/guilds';
import { Messages } from './caches/messages';
import { Users } from './caches/users';
@@ -103,7 +103,7 @@ export class Client {
message = new Message().setContent(message);
}
return Message[fromDiscord](DiscordMessage.fromAPIResponse(await this.api.post(`/channels/${channel_id}/messages`, message.toJSON())));
return Message[fromDiscord](await this.api.post<DiscordMessage>(`/channels/${channel_id}/messages`, message.toJSON()));
}
chatCommands = {