我希望我的員工角色可以編輯、刪除這個創建的頻道。client.on('message', message =>{if (!message.content.startsWith('*open-channel')) return; //This line for some bug happens in my botif (message.channel.id !== '759430340972118026') return; // I set a channel for the users can only use //this command inif(message.author.bot || message.channel.type === "dm") return; //For bugs againif(!message.member.roles.cache.some(role => role.name === 'OWNER')) { //This command only //for owner role now. return message.reply('You should be OWNER for using this command.').then(message => {message.delete({ timeout: 8000 })})} const messageArray = message.content.split(' ');const cmd = messageArray[0];const args = messageArray.slice(1).join(' ').toUpperCase(); if (message.content.startsWith('*open-channel'))var kanal = message.guild.channels.create(`${args} - ${message.author.tag}`,{type : 'voice'}).then(channel => channel.setParent(message.guild.channels.cache.find(channel => channel.name === "USER CHANNELS"))); //setParent moves my channel to choosen catagory. And 'args - message.author.tag' is channel name message.channel.send("Its done now buddy :3");})如果我寫錯了,請原諒我的英語不好。:(
我可以設置我創建的頻道權限,比如只有我的員工角色可以編輯或刪除它嗎?到目前為止我的代碼:
喵喵時光機
2023-04-01 17:35:38