Replaced clang format with prettuier (sadly)

This commit is contained in:
2023-12-28 16:47:52 +01:00
parent ca5bbd0b81
commit 117140fe9d
99 changed files with 13519 additions and 12011 deletions

View File

@@ -6,28 +6,32 @@ import fs = require("fs")
function loadButtonEvents(client: Client) {
const btnPath = path.join(__dirname, "..", "..", "events", "buttons")
const btnFiles = fs.readdirSync(btnPath).filter(file => file.endsWith(".js"))
const btnFiles = fs
.readdirSync(btnPath)
.filter(file => file.endsWith(".js"))
for (const file of btnFiles) {
const filePath = path.join(btnPath, file)
const btn: Button = require(filePath)
if ("name" in btn && "execute" in btn && btn.type === "button") {
client.buttons.set(btn.name, btn)
} else {
console.log(`[WARNING] The button at ${filePath} is missing a required "name", "execute" or "type" property.`)
console.log(
`[WARNING] The button at ${filePath} is missing a required "name", "execute" or "type" property.`,
)
}
}
client.on(Events.InteractionCreate, async interaction => {
if (!interaction.isButton())
return
if (!interaction.isButton()) return
const button = client.buttons.get(interaction.customId)
if (!button) {
console.error(`No event matching ${interaction.customId} was found.`)
console.error(
`No event matching ${interaction.customId} was found.`,
)
return
}
@@ -37,7 +41,7 @@ function loadButtonEvents(client: Client) {
console.error(error)
await interaction.reply({
content: "There was an error while executing this event!",
ephemeral: true
ephemeral: true,
})
}
})