#sad
1 messages · Page 1 of 1 (latest)
After setTimeout
aight
I feel like im wrong but :
if(interaction.isButton()){
if(interaction.customId === 'ticketCreate'){
const cd = [];
if(cd.includes(i.user.id)) {
return
} else {
cd.push(i.user.id);
setTimeout(function(){
const index = cd.indexOf(i.user.id);
cd.splice(index, 1);
}
)}
await interaction.deferUpdate()
interaction.guild.channels.create(`ticket-${interaction.user.username}`, {
type: "GUILD_TEXT",
parent: "961673841334186035",
topic: `${interaction.user.tag}'s ticket`,
permissionOverwrites: [
{
id: interaction.user.id,
allow: ["VIEW_CHANNEL", "SEND_MESSAGES"]
},
{
id: support.id,
allow: ["VIEW_CHANNEL", "SEND_MESSAGES"]
},
{
id: everyone.id,
deny: ["VIEW_CHANNEL", "SEND_MESSAGES"]
}
]
}).then(c => {
const ticketEmbed = new MessageEmbed()
.setTitle('New ticket')
.setDescription(`Thank you for opening the ticket. \n
You can ask help for whatever you want (related to the server / housing relate wid ofcourse)\n
Our staff will answer everything soon!`)
.setTimestamp()
.setFooter('Mawios\'s Stuff')
.setColor('RANDOM')
c.send({ content: `${support}`, embeds: [ticketEmbed], components: [deleteButton] })
})
}}
}
)
It looks fine to me but you put the rest of your code outside of the second if statement idk if its intentional
would it affect my code?
Yes
umm what do i do then
Put it inside the second if statement block
I feel like I did it wrong
becaus emy english sucsk as frick and i dont understand every 2nd word lol
You just need to put the code inside the second if statement {} curly brackets