unchill
Explore posts from serversDIAdiscord.js - Imagine an app
•Created by unchill on 7/30/2023 in #djs-questions
Adding a slash command to do the same thing a button already does
I am working on a ticket system. I have a button called "Close ticket" on a message and it is sent when a new ticket is made. When you click this button it comes up with a message asking if you are sure you want to close the ticket and that message has a "Cancel" button which deletes the message and a "Yes" button that deletes the channel. I have registered a command called /close and I want it to bring up the same message asking if you are sure you want to close the ticket. Can I do this?
The code for the "closeTicket" button:
} else if(interaction.customId == "closeTicket") {
const confirmcloseEmbed = new EmbedBuilder()
.setColor(0x2b2d31)
.setAuthor({ name: 'Are you sure you want to end this conversation?', iconURL: 'Logo-02.png' });
const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setLabel("Yes")
.setCustomId("yesCloseTicket")
.setStyle(ButtonStyle.Secondary),
new ButtonBuilder()
.setLabel("Cancel")
.setCustomId("cancelCloseTicket")
.setStyle(ButtonStyle.Secondary)
);
interaction.reply({
ephemeral: false,
components: [ row ],
embeds: [ confirmcloseEmbed ]
});
} else if(interaction.customId == "yesCloseTicket") {
interaction.channel.delete();
} else if(interaction.customId == "cancelCloseTicket") {
interaction.message.delete();
7 replies
DIAdiscord.js - Imagine an app
•Created by unchill on 7/29/2023 in #djs-questions
Questions about editing ephemeral embed messages
I am working on editing ephemeral messages but I don't know how to. I dont understand how works.
I am using a button to try and edit the message
12 replies
DIAdiscord.js - Imagine an app
•Created by unchill on 7/10/2023 in #djs-questions
Embed Help
Can someone tell me why this doesn't work.
17 replies
DIAdiscord.js - Imagine an app
•Created by unchill on 7/10/2023 in #djs-questions
Member count help
I have the following code but I want it to exclude bots, any hep would be appreciated. Thanks!
client.on('ready' , (c) => {
let memberCount = 0;
client.guilds.cache.forEach(g => {
memberCount = memberCount + g.memberCount;
});
client.user.setActivity({
name: memberCount + " Members",
type: ActivityType.Watching
});
});
6 replies