I am making a ticket system with discord.js
I tried to when a member reacts to the message with the emoji, the ticket will close, but after running it, it shows an error
if (reaction.emoji.name == '🔒') {
if(!reaction.channel.name.includes("ticket")) return;
channel.delete()
}
Even though you didn't specify the error I can see that you never defined "channel". If you want to delete the channel in which the reaction was added use:
reaction.message.channel.delete();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.