Converted main codebase to typescript

Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
2023-12-28 13:17:57 +01:00
parent 1d9ded82a4
commit 68fde04bbb
122 changed files with 14230 additions and 1834 deletions

View File

@@ -0,0 +1,34 @@
import { ChatInputCommandInteraction, ButtonInteraction } from "discord.js"
import { Event } from "../../../interfaces"
const event: Event = {
name: "logBtnsCmds",
description: "Logs all button and command interactions",
type: "event",
event: "interactionCreate",
execute(interaction: ChatInputCommandInteraction | ButtonInteraction) {
if (interaction.isCommand()) {
try {
console.log(interaction.user.username + " ran " +
interaction.commandName + " " +
interaction.options.getSubcommand()
)
} catch {
console.log(interaction.user.username + " ran " +
interaction.commandName
)
}
}
if (interaction.isButton()) {
console.log(interaction.user.username + "#" +
interaction.user.discriminator + " clicked " +
interaction.customId
)
return
}
}
}
export = event