fix: opcode 24 (Interaction search function)

Todo: Rewrite slash command ...
This commit is contained in:
March 7th
2022-06-12 19:13:12 +07:00
parent 8eaa5e0c72
commit 07d52ee41b
11 changed files with 45 additions and 54 deletions

View File

@@ -626,9 +626,11 @@ class ApplicationCommand extends Base {
// ApplicationCommandData
version: this.version,
id: this.id,
guild_id: message.guildId,
name: this.name,
type: ApplicationCommandTypes[this.type],
options: option_,
attachments: [], // Todo
},
nonce: SnowflakeUtil.generate(),
},
@@ -648,7 +650,7 @@ class ApplicationCommand extends Base {
* await command.sendContextMenu(messsage);
*/
async sendContextMenu(message, sendFromMessage = false) {
if (!(message instanceof Message && !sendFromMessage)) {
if (!sendFromMessage && !(message instanceof Message)) {
throw new TypeError('The message must be a Discord.Message');
}
if (this.type == 'CHAT_INPUT') return false;