Created
June 5, 2020 21:10
-
-
Save EveryDayRains/2f0b03bb110d9aa043bac59d43fbc533 to your computer and use it in GitHub Desktop.
Приватные войсы на djs v12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { categoryID, voiceID} = config | |
module.exports = async (client, oldState, newState) => { | |
if(newState.channelID === voiceID) { | |
newState.guild.channels.create("Комнатка ☁️", { | |
type: "VOICE", | |
parent: categoryID, | |
permissionOverwrites: [ | |
{ | |
id: newState.guild.id, | |
allow: ["VIEW_CHANNEL"] | |
}, | |
{ | |
id: newState.member.id, | |
allow: ["VIEW_CHANNEL", "MANAGE_CHANNELS"] | |
} | |
] | |
}).then(ch => {newState.setChannel(ch) , ch.setUserLimit(42) }) | |
} | |
if(oldState.channel && !oldState.channel.members.size && oldState.channel.parentID === categoryID && oldState.channelID !== voiceID) oldState.channel.delete(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment