Converted main codebase to typescript
Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
34
src/events/server/interactions/logBtnsCmds.ts
Normal file
34
src/events/server/interactions/logBtnsCmds.ts
Normal 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
|
||||
Reference in New Issue
Block a user