remove welcome message
This commit is contained in:
parent
925c52a8f6
commit
75e9252f30
1 changed files with 31 additions and 0 deletions
31
commands/admin/unwelcome.js
Normal file
31
commands/admin/unwelcome.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
const { Command } = require('discord-akairo');
|
||||
const fs = require('fs');
|
||||
|
||||
class unwelcomeCommand extends Command {
|
||||
constructor() {
|
||||
super('unwelcome', {
|
||||
aliases: ['unwelcome'],
|
||||
category: 'admin',
|
||||
channelRestriction: 'guild',
|
||||
userPermissions: ['MANAGE_CHANNELS'],
|
||||
description: {
|
||||
content: 'Delete welcome message',
|
||||
usage: '[]',
|
||||
examples: ['']
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async exec(message) {
|
||||
fs.unlink(`./welcome/${message.guild.id}.json`, (err) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return message.channel.send('An error has occured, there is most likely no welcome message set!');
|
||||
} else {
|
||||
return message.channel.send('Disabled unwelcome message');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = unwelcomeCommand;
|
Loading…
Reference in a new issue