ScremerMemer
ScremerMemer
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/15/2024 in #djs-questions
This interaction failed, button not working, djs v14
mb i wasnt thinking at all, thanks for ur inputs it works now
15 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/15/2024 in #djs-questions
This interaction failed, button not working, djs v14
No description
15 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/15/2024 in #djs-questions
This interaction failed, button not working, djs v14
No description
15 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/15/2024 in #djs-questions
This interaction failed, button not working, djs v14
ok let me try it out
15 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/15/2024 in #djs-questions
This interaction failed, button not working, djs v14
Yes that works thanks, but I'm trying to make sure that the Back button takes me back to the panel i previously was in and not just the first panel, how do u think i can go about this
15 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/15/2024 in #djs-questions
This interaction failed, button not working, djs v14
ok thanks ill try
15 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/15/2024 in #djs-questions
This interaction failed, button not working, djs v14
15 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/15/2024 in #djs-questions
This interaction failed, button not working, djs v14
When the user clicks this button the message is shown:
const { ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
const GuildSettings = require('../../models/GuildSettings');
const { generatePreviewEmbed } = require('../../commands/setup');

module.exports = {
customId: 'setup_preview',
async execute(interaction) {
try {
const settings = await GuildSettings.findOne({ guildId: interaction.guildId });
const embed = generatePreviewEmbed(settings);

const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('setup_preview_back')
.setLabel('Back to Setup')
.setStyle(ButtonStyle.Secondary)
.setEmoji('⬅️')
);

await interaction.update({
embeds: [embed],
components: [row],
ephemeral: true
});
} catch (error) {
console.error('Error in preview:', error);
await interaction.reply({
content: 'An error occurred while showing preview.',
ephemeral: true
});
}
}
};
const { ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
const GuildSettings = require('../../models/GuildSettings');
const { generatePreviewEmbed } = require('../../commands/setup');

module.exports = {
customId: 'setup_preview',
async execute(interaction) {
try {
const settings = await GuildSettings.findOne({ guildId: interaction.guildId });
const embed = generatePreviewEmbed(settings);

const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('setup_preview_back')
.setLabel('Back to Setup')
.setStyle(ButtonStyle.Secondary)
.setEmoji('⬅️')
);

await interaction.update({
embeds: [embed],
components: [row],
ephemeral: true
});
} catch (error) {
console.error('Error in preview:', error);
await interaction.reply({
content: 'An error occurred while showing preview.',
ephemeral: true
});
}
}
};
15 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/15/2024 in #djs-questions
This interaction failed, button not working, djs v14
Code that sends this message: https://srcb.in/rO19rzGTnq
15 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/15/2024 in #djs-questions
This interaction failed, button not working, djs v14
Button handler:
const fs = require('fs');
const path = require('path');

module.exports = (client) => {
const buttonsPath = path.join(__dirname, '../../buttons');
const buttonFolders = fs.readdirSync(buttonsPath)
.filter(folder => !folder.startsWith('.'));

for (const folder of buttonFolders) {
const buttonFiles = fs.readdirSync(path.join(buttonsPath, folder)).filter(file => file.endsWith('.js') && !file.startsWith('.'));

for (const file of buttonFiles) {
const filePath = path.join(buttonsPath, folder, file);
const button = require(filePath);

if ('customId' in button && 'execute' in button) {
client.buttons.set(button.customId, button);
} else {
console.log(`[WARNING] The button at ${filePath} is missing required "customId" or "execute" property.`);
}
}
}
};
const fs = require('fs');
const path = require('path');

module.exports = (client) => {
const buttonsPath = path.join(__dirname, '../../buttons');
const buttonFolders = fs.readdirSync(buttonsPath)
.filter(folder => !folder.startsWith('.'));

for (const folder of buttonFolders) {
const buttonFiles = fs.readdirSync(path.join(buttonsPath, folder)).filter(file => file.endsWith('.js') && !file.startsWith('.'));

for (const file of buttonFiles) {
const filePath = path.join(buttonsPath, folder, file);
const button = require(filePath);

if ('customId' in button && 'execute' in button) {
client.buttons.set(button.customId, button);
} else {
console.log(`[WARNING] The button at ${filePath} is missing required "customId" or "execute" property.`);
}
}
}
};
15 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/15/2024 in #djs-questions
This interaction failed, button not working, djs v14
No description
15 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/12/2024 in #djs-questions
Can't get this to work Interaction failed discord.js
Thanks tho
8 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/12/2024 in #djs-questions
Can't get this to work Interaction failed discord.js
It works now thanks, I dont know how I didnt think of that before- probably cause of too much working
8 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/12/2024 in #djs-questions
Can't get this to work Interaction failed discord.js
Thanks I'll try it out
8 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/12/2024 in #djs-questions
Can't get this to work Interaction failed discord.js
8 replies
DIAdiscord.js - Imagine an app
Created by ScremerMemer on 11/12/2024 in #djs-questions
Can't get this to work Interaction failed discord.js
Version: 14.16.3
8 replies