Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // lockdown command
- if (message.member.roles.cache.some(role => role.name === 'staff')) {
- const textChannels = message.guild.channels.cache.filter(c => c.type == 'text');
- const voiceChannels = message.guild.channels.cache.filter(c => c.type == 'voice');
- const verified = message.guild.roles.cache.find(role => role.name === 'Verified');
- textChannels.forEach(channel => {
- channel.overwritePermissions([
- {
- id: verified,
- deny: ['SEND_MESSAGES'],
- }
- ]);
- })
- voiceChannels.forEach(channel => {
- channel.overwritePermissions([
- {
- id: verified,
- deny: ['SPEAK']
- }
- ])
- })
- message.channel.send('Discord is now on lockdown!');
- }
- //unlock command
- if (message.member.roles.cache.some(role => role.name === 'staff')) {
- const textChannels = message.guild.channels.cache.filter(c => c.type == 'text');
- const voiceChannels = message.guild.channels.cache.filter(c => c.type == 'voice');
- const verified = message.guild.roles.cache.find(role => role.name === 'Verified');
- textChannels.forEach(channel => {
- channel.overwritePermissions([
- {
- id: verified,
- allow: ['SEND_MESSAGES'],
- }
- ]);
- })
- voiceChannels.forEach(channel => {
- channel.overwritePermissions([
- {
- id: verified,
- allow: ['SPEAK']
- }
- ])
- })
- message.channel.send('Discord has now been unlocked');
- }
Add Comment
Please, Sign In to add comment