Comparing version 2.5.0-dev.4 to 2.5.0-dev.5
@@ -1,2 +0,2 @@ | ||
import { ContextMenuCommandInteraction, Client, ApplicationCommandType } from "discord.js"; | ||
import { ContextMenuCommandInteraction, Client, ApplicationCommandType, ContextMenuCommandBuilder } from "discord.js"; | ||
/** | ||
@@ -13,13 +13,10 @@ * @class | ||
/** | ||
* | ||
* @param name Name of the context menu. | ||
* Build the actual context menu. | ||
* @param context Context Menu Object | ||
*/ | ||
constructor(name: string); | ||
constructor(context: { | ||
data: ContextMenuCommandBuilder; | ||
execute: (interaction: ContextMenuCommandInteraction, client?: Client) => void; | ||
}); | ||
/** | ||
* Sets the type of the context menu | ||
* @param type Context Menu type. | ||
* @returns | ||
*/ | ||
setType(type: ApplicationCommandType): ContextMenuBuilder; | ||
/** | ||
* Sets the deleted property of the context menu. | ||
@@ -26,0 +23,0 @@ * @param deleted Boolean indicating whether the context menu is deleted. |
@@ -10,19 +10,12 @@ "use strict"; | ||
/** | ||
* | ||
* @param name Name of the context menu. | ||
* Build the actual context menu. | ||
* @param context Context Menu Object | ||
*/ | ||
constructor(name) { | ||
constructor(context) { | ||
this.isCommand = false; // This is so that when it's read by th command handler, it's skipped. And because it's its own interaction like slash commands, the interaction handler reads it seprately. | ||
this.name = name; | ||
this.name = context.data.toJSON().name; | ||
this.type = context.data.toJSON().type; | ||
this.callback = context.execute; | ||
} | ||
/** | ||
* Sets the type of the context menu | ||
* @param type Context Menu type. | ||
* @returns | ||
*/ | ||
setType(type) { | ||
this.type = type; | ||
return this; | ||
} | ||
/** | ||
* Sets the deleted property of the context menu. | ||
@@ -29,0 +22,0 @@ * @param deleted Boolean indicating whether the context menu is deleted. |
{ | ||
"name": "ic4d", | ||
"version": "2.5.0-dev.4", | ||
"version": "2.5.0-dev.5", | ||
"description": "Discord.js Interaction and Command handler 4 Dummies", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
127316
1729