关闭工单系统不起作用... Discord.js

问题描述

您好,我的 discord 票务系统出现了一些问题,这让我感到非常困惑......它在创建票务系统的渠道时不起作用,这真的让我感到困惑......

代码

Open ticket command:
const discord = require('discord.js')


module.exports = {
    name: 'ticket',description: "opens a ticket",execute(message,args){
        const user = message.author.id;
        const name = "ticket-" + user;
        if(message.guild.channels.cache.find(ch => ch.name == name)){
            message.channel.send("You have already opened a ticket!")
        }else{
    message.guild.channels.create(name).then((chan)=>{
    chan.updateOverwrite(message.guild.roles.everyone,{
        SEND_MESSAGES: false,VIEW_CHANNEL: false
    })
    chan.updateOverwrite(user,{
        SEND_MESSAGES: true,VIEW_CHANNEL: true
    })
    message.channel.send("I have created a ticket for you! Please go to the channel at the top of the server,Only you will have access to it and it will be called ticket(id)");
    chan.send("Support will be here shortly").then((m)=>{
        m.pin()
    })
    })   

     }
    }
}

close ticket command (this is were the error is):

const discord = require('discord.js');

module.exports = {
    name: 'endticket',description: "ends the ticket",execute(client,message,args){
        if(!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("Only a moderator can end a ticket!")

        if(message.member.hasPermission("ADMINISTRATOR")) message.channnel.delete()
    }
}

console error:

TypeError: Cannot read property 'delete' of undefined

我不明白出了什么问题... 谢谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...