Dani
Dani
DIAdiscord.js - Imagine an app
Created by Dani on 5/26/2024 in #djs-questions
Bot responding from a button, and answer with a text and two buttons more
I really thought that was diff, sorry jajaja
10 replies
DIAdiscord.js - Imagine an app
Created by Dani on 5/26/2024 in #djs-questions
Bot responding from a button, and answer with a text and two buttons more
Ty :churumbel_cora_dev:
10 replies
DIAdiscord.js - Imagine an app
Created by Dani on 5/26/2024 in #djs-questions
Bot responding from a button, and answer with a text and two buttons more
ooh... in the same way?
10 replies
DIAdiscord.js - Imagine an app
Created by Dani on 5/26/2024 in #djs-questions
Bot responding from a button, and answer with a text and two buttons more
Any idea about how to do that? @Qjuh
10 replies
DIAdiscord.js - Imagine an app
Created by Dani on 5/26/2024 in #djs-questions
Bot responding from a button, and answer with a text and two buttons more
Is a ticket-system
10 replies
DIAdiscord.js - Imagine an app
Created by Dani on 5/26/2024 in #djs-questions
Bot responding from a button, and answer with a text and two buttons more
This is my Code
10 replies
DIAdiscord.js - Imagine an app
Created by Dani on 5/26/2024 in #djs-questions
Bot responding from a button, and answer with a text and two buttons more
const Discord = require('discord.js'); const guildTicketCategoryId = '1242529125424435311'; // Categoria donde se abriran los tickets const AdminRole = '1242270979896381461'; // Id Rol de moderacion const Staff = '1242471734528053389' // Id Rol de Staff const Helpdesk = '<@&1242521614063501355>'; // Id Rol de Helpdesk const ticketPanelStaffButton = new Discord.ActionRowBuilder().addComponents( new Discord.ButtonBuilder() .setCustomId('panel-create') .setLabel('Panel de Staff') .setEmoji('💻') .setStyle(2) ) async function main (interaction) { const {user, guild} = interaction; const ticketType = interaction.values[0]; const tickets = guild.channels.cache.filter(channel => channel.parentId === guildTicketCategoryId); if(tickets.some(ticket => ticket.topic === user.id)) return interaction.reply({content: 'Ya tienes un ticket abierto', ephemeral: true}) // Si el usuario no tiene tickets abiertos, procedemos con la creacion del ticket: interaction.reply({content: '- Tu ticket está siendo creado...', ephemeral: true}) .then(() => { guild.channels.create({ name: ticketType+'-'+user.username.slice(0, 25-ticketType.length), topic: user.id, type: Discord.ChannelType.GuildText, parent: guildTicketCategoryId, permissionOverwrites: [ {id: interaction.guild.roles.everyone, deny: [Discord.PermissionsBitField.Flags.ViewChannel]}, {id: Staff, allow: [Discord.PermissionsBitField.Flags.ViewChannel]}, {id: interaction.user.id, allow: [Discord.PermissionsBitField.Flags.ViewChannel]} ] }).then(channel => { interaction.editReply({content: - Tu ticket ha sido creado: ${channel}}); channel.send({ content: ¡¡Bienvenido ${user}!! 👋, \nAcabas de abrir un ticket por el siguiente motivo: __${ticketType}__, \nEl ${Helpdesk} se pondrá en contacto con usted lo antes posible por este mismo canal \n\nFecha: ${new Date().toLocaleString()}, components: [ticketPanelStaffButton] }); }) }); }; module.exports = main;
10 replies
DIAdiscord.js - Imagine an app
Created by Dani on 5/26/2024 in #djs-questions
Bot responding from a button, and answer with a text and two buttons more
yes, I know that sorry, the real problem goes when I dont know how to do that when the Staff click on the button "Panel de Staff", the bot responses with a text and two more buttons
10 replies