简体   繁体   English

反应 删除频道 | Discord.js

[英]Reaction Delete channel | Discord.js

I am making a ticket system with discord.js我正在使用 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();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM