Created
July 22, 2020 09:54
-
-
Save AlexzanderFlores/73b54866bcae7baaad468eca84608f07 to your computer and use it in GitHub Desktop.
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
module.exports = { | |
commands: ['deletechannel', 'delchannel', 'delc'], | |
minArgs: 1, | |
expectedArgs: '<channel name>', | |
permissionError: 'You must be an administrator to use this.', | |
permission: 'ADMINISTRATOR', | |
callback: (message, arguments, text) => { | |
const { guild } = message | |
const channel = guild.channels.cache | |
.filter((channel) => { | |
return channel.name === text | |
}) | |
.first() | |
if (!channel) { | |
message.reply('That channel does not exist.') | |
return | |
} | |
channel.delete() | |
message.reply('Channel deleted!') | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment