Skip to content

Commit

Permalink
refactor(discordbot): remove attempt to register context menu commands
Browse files Browse the repository at this point in the history
The DiscordBot class will not attempt to register a command as a context menu using the
command.data.types.contextMenu property, and it'll no longer be used
  • Loading branch information
The Alpha committed Sep 30, 2023
1 parent 1f3a5b0 commit 0735c50
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions src/core/discordBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ const {
storeFolderPaths,
readFolderPaths
} = require("@disqada/pathfinder");
const {
ApplicationCommandType,
Client,
Collection,
Events,
GatewayIntentBits
} = require("discord.js");
const { Client, Collection, Events, GatewayIntentBits } = require("discord.js");
const { BotCommand } = require("../entities/command");
const { BotEvent } = require("../entities/event");
const interactionCreate = require("../events/interactionCreate");
Expand Down Expand Up @@ -148,16 +142,7 @@ class DiscordBot {
* @returns {undefined}
*/
registerCommand(command) {
if (command.data.types.chatInput) {
command.data.type = ApplicationCommandType.ChatInput;
this.commands.set(command.data.name, command);
}

if (command.data.types.contextMenu) {
// Note: The 2 is ApplicationCommandType.User
command.data.type = command.data.types.contextMenu + 2;
this.commands.set(command.data.name, command);
}
this.commands.set(command.data.name, command);

return {
name: command.data.name,
Expand Down

0 comments on commit 0735c50

Please sign in to comment.