Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlexzanderFlores/73b54866bcae7baaad468eca84608f07 to your computer and use it in GitHub Desktop.
Save AlexzanderFlores/73b54866bcae7baaad468eca84608f07 to your computer and use it in GitHub Desktop.
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