import { mainLogger } from "../../config";
import { ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder, ModalActionRowComponentBuilder, ButtonInteraction } from "discord.js";
module.exports = async (interaction: ButtonInteraction) => {
// Creating the logging Object for our command handler
const buttonExecutionLoggingObj = { main: false, sub: true };
const buttonExecutionLogger = mainLogger.getSubLogger({ name: "ButtonExecutionLogger" }, buttonExecutionLoggingObj);
// Loglevel setting 0 = silly, 1 = trace, 2 = debug, 3 = info, 4 = warn, 5 = error, 6 = fatal
buttonExecutionLogger.settings.minLevel = 2;
buttonExecutionLogger.debug("Button execution started...");
buttonExecutionLogger.debug("Interaction customId ", interaction.customId)
// Check if the interaction is a command
buttonExecutionLogger.debug(`Checking if the interaction is with a button...`);
if (!interaction.isButton()) {
buttonExecutionLogger.trace("Interaction is not with a button.");
return;
}
// Doing things afterwards...
}
import { mainLogger } from "../../config";
import { ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder, ModalActionRowComponentBuilder, ButtonInteraction } from "discord.js";
module.exports = async (interaction: ButtonInteraction) => {
// Creating the logging Object for our command handler
const buttonExecutionLoggingObj = { main: false, sub: true };
const buttonExecutionLogger = mainLogger.getSubLogger({ name: "ButtonExecutionLogger" }, buttonExecutionLoggingObj);
// Loglevel setting 0 = silly, 1 = trace, 2 = debug, 3 = info, 4 = warn, 5 = error, 6 = fatal
buttonExecutionLogger.settings.minLevel = 2;
buttonExecutionLogger.debug("Button execution started...");
buttonExecutionLogger.debug("Interaction customId ", interaction.customId)
// Check if the interaction is a command
buttonExecutionLogger.debug(`Checking if the interaction is with a button...`);
if (!interaction.isButton()) {
buttonExecutionLogger.trace("Interaction is not with a button.");
return;
}
// Doing things afterwards...
}