From 75e9252f30704c09e85af2f30ee3a33b6a608230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Thu, 9 May 2019 21:29:17 +0200 Subject: [PATCH] remove welcome message --- commands/admin/unwelcome.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 commands/admin/unwelcome.js diff --git a/commands/admin/unwelcome.js b/commands/admin/unwelcome.js new file mode 100644 index 00000000..e84539c0 --- /dev/null +++ b/commands/admin/unwelcome.js @@ -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; \ No newline at end of file