Skip to content

Commit

Permalink
delete unused stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Ballaual committed Apr 3, 2023
1 parent 9aecc94 commit d892376
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions handlers/interactionCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,3 @@ module.exports = (client) => {
executeInteraction(interaction, client.commands)
})
}

// TO-DO - Merge these stuff

// const humanizeDuration = require("humanize-duration")
// const Timeout = new Set()

/* client.on("interactionCreate", async (interaction) => {
if (interaction.isCommand() || interaction.isContextMenu()) {
if (!client.slash.has(interaction.commandName)) return
if (!interaction.guild) return
const command = client.slash.get(interaction.commandName)
try {
if (command.timeout) {
if (Timeout.has(`${interaction.user.id}${command.name}`)) {
return interaction.reply({ content: `You need to wait **${humanizeDuration(command.timeout, { round: true })}** to use command again`, ephemeral: true })
}
}
if (command.permissions) {
if (!interaction.member.permissions.has(command.permissions)) {
return interaction.reply({ content: `:x: You need \`${command.permissions}\` to use this command`, ephemeral: true })
}
}
command.run(interaction, client)
Timeout.add(`${interaction.user.id}${command.name}`)
setTimeout(() => {
Timeout.delete(`${interaction.user.id}${command.name}`)
}, command.timeout)
} catch (error) {
console.error(error)
await interaction.reply({ content: ":x: There was an error while executing this command!", ephemeral: true })
}
}
}); */

0 comments on commit d892376

Please sign in to comment.