Skip to content

Commit

Permalink
fix it giving errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LarmuseauNiels committed Apr 24, 2023
1 parent 42255f5 commit 73f4d84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
14 changes: 8 additions & 6 deletions events/interactionCreate.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
module.exports = {
name: "interactionCreate",
async execute(interaction) {
console.log("executing interaction");
global.bugsnag.startSession();
global.bugsnag.leaveBreadcrumb(
interaction.commandName ?? "No command name"
);
try {
if (interaction.isButton()) {
console.log(interaction.customId);
let buttonId = interaction.customId.split("_")[0];
let button = global.client.buttons.get(buttonId);
await button.execute(interaction);
if (button) await button.execute(interaction);
}
if (interaction.isMessageContextMenuCommand()) {
console.log(interaction.commandName);
let menu = global.client.contextMenus.get(interaction.commandName);
await menu.execute(interaction);
if (menu) await menu.execute(interaction);
} else if (interaction.isUserContextMenuCommand()) {
console.log(interaction.commandName);
let menu = global.client.contextMenus.get(interaction.commandName);
await menu.execute(interaction);
if (menu) await menu.execute(interaction);
} else {
if (interaction.isCommand()) {
console.log(interaction.commandName);
let command = global.client.commands.get(interaction.commandName);
await command.execute(interaction);
if (command) await command.execute(interaction);
}
}
if (interaction.isModalSubmit()) {
let modalId = interaction.customId.split("_")[0];
let modal = global.client.modals.get(modalId);
await modal.execute(interaction);
if (modal) await modal.execute(interaction);
}
if (interaction.isAutocomplete()) {
let command = global.client.commands.get(interaction.commandName);
await command.autocomplete(interaction);
if (command) await command.autocomplete(interaction);
}
} catch (error) {
global.bugsnag.notify(error);
Expand Down
7 changes: 1 addition & 6 deletions interactions/commands/embedBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,7 @@ module.exports = {
.setCustomId("embed_creator_end")
.setLabel("End Interaction")
.setEmoji("🛑")
.setStyle(ButtonStyle.Secondary),
new ButtonBuilder()
.setCustomId("embed_creator_help")
.setLabel("Help")
.setEmoji("ℹ️")
.setStyle(ButtonStyle.Primary)
.setStyle(ButtonStyle.Secondary)
),
],
});
Expand Down

0 comments on commit 73f4d84

Please sign in to comment.