Lex
Lex
DIAdiscord.js - Imagine an app
Created by Lex on 9/30/2023 in #djs-questions
Discord.js Inbedded buttons not wokring
Idk i did some changes that u said
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');

const PRIMARY = 'Primary';

module.exports = {
name: 'ticketinfo',
description: 'Displays information about The Hierarchy Tickets.',
async execute(interaction) {
const roleID = '1156687225300467774';
const member = await interaction.guild.members.fetch(interaction.user.id);

if (!member || !member.roles.cache.some(role => role.id === roleID)) {
return await interaction.reply({ content: 'You do not have permission to use this command.', ephemeral: true });
}

// Create the button
const button = new ButtonBuilder()
.setCustomId('create-ticket');

// Set the style of the button
if (member.roles.cache.some(role => role.id === roleID)) {
button.setStyle(ButtonStyle.PRIMARY);
} else {
button.setStyle(ButtonStyle.SECONDARY);
}

// Create the action row
const row = new ActionRowBuilder()
.addComponents(button);

// Create the embed
const embed = new EmbedBuilder()
.setColor('#00FF00') // Sets the color to green
.addFields(
{ name: '**Contact**', value: `To open a ticket, <@1156691598550249583>!`, inline: false }
)
.setFooter({ text: 'If you need additional support/tickets are not working, Dm the owner' });

// Send the reply
await interaction.reply({ embeds: [embed], components: [row] });
},
};
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');

const PRIMARY = 'Primary';

module.exports = {
name: 'ticketinfo',
description: 'Displays information about The Hierarchy Tickets.',
async execute(interaction) {
const roleID = '1156687225300467774';
const member = await interaction.guild.members.fetch(interaction.user.id);

if (!member || !member.roles.cache.some(role => role.id === roleID)) {
return await interaction.reply({ content: 'You do not have permission to use this command.', ephemeral: true });
}

// Create the button
const button = new ButtonBuilder()
.setCustomId('create-ticket');

// Set the style of the button
if (member.roles.cache.some(role => role.id === roleID)) {
button.setStyle(ButtonStyle.PRIMARY);
} else {
button.setStyle(ButtonStyle.SECONDARY);
}

// Create the action row
const row = new ActionRowBuilder()
.addComponents(button);

// Create the embed
const embed = new EmbedBuilder()
.setColor('#00FF00') // Sets the color to green
.addFields(
{ name: '**Contact**', value: `To open a ticket, <@1156691598550249583>!`, inline: false }
)
.setFooter({ text: 'If you need additional support/tickets are not working, Dm the owner' });

// Send the reply
await interaction.reply({ embeds: [embed], components: [row] });
},
};
`
7 replies
DIAdiscord.js - Imagine an app
Created by Lex on 9/30/2023 in #djs-questions
Discord.js Inbedded buttons not wokring
💀
7 replies
DIAdiscord.js - Imagine an app
Created by Lex on 9/30/2023 in #djs-questions
Discord.js Inbedded buttons not wokring
idek what this is goin on abt
7 replies
DIAdiscord.js - Imagine an app
Created by Lex on 9/30/2023 in #djs-questions
Discord.js Inbedded buttons not wokring
"ValidationError > s.nativeEnum(T) Expected the value to be a string or number Received: | undefined at NativeEnumValidator.handle (/Users/lex/TheHierarchysBot/Bot/node_modules/@sapphire/shapeshift/dist/index.js:1871:25) at NativeEnumValidator.parse (/Users/lex/TheHierarchysBot/Bot/node_modules/@sapphire/shapeshift/dist/index.js:212:88) at ButtonBuilder.setStyle (/Users/lex/TheHierarchysBot/Bot/node_modules/@discordjs/builders/dist/index.js:636:44) at Object.execute (/Users/lex/TheHierarchysBot/Bot/commands/message/ticketinfo.js:20:20) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Client.<anonymous> (/Users/lex/TheHierarchysBot/Bot/index.js:101:9) "
7 replies
DIAdiscord.js - Imagine an app
Created by Lex on 9/30/2023 in #djs-questions
Discord.js Inbedded buttons not wokring
well damn im dumb 💀
7 replies
DIAdiscord.js - Imagine an app
Created by Lex on 9/29/2023 in #djs-questions
Direct Messages Not Receiving
Okay thanks alot, I think i got it. That went over my head 💀
6 replies
DIAdiscord.js - Imagine an app
Created by Lex on 9/29/2023 in #djs-questions
Direct Messages Not Receiving
14.13.0 ds.js, v18.12.1 node. No errors, But heres the code im using to try and see the messages. I made chatgpt // everything to make it easier for yall,
6 replies