From ecadc6dbba2e67f260a46435a632323177ba1b8f Mon Sep 17 00:00:00 2001 From: Alee Date: Sun, 25 Feb 2018 10:35:54 -0500 Subject: Added asyncPowerOff --- bot.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bot.js b/bot.js index 112cdc5..ff0cd81 100644 --- a/bot.js +++ b/bot.js @@ -2,7 +2,7 @@ const Discord = require('discord.js'); const moment = require('moment'); const client = new Discord.Client(); const config = require('./config.json'); -const aqVersion = '1.2.2'; +const aqVersion = '1.2.3'; const prefix = 'aq:'; const log = message => { @@ -128,13 +128,17 @@ client.on('message', message => { } else { message.channel.send("Access Denied"); }*/ + const asyncPowerOff = async () => { + await message.reply(getBoshyTime(message.guild) + 'AstralQuote is now powering off!'); + console.log('[i] AstralQuote is now powering off...'); + process.exit(0); + } + if (message.author.id !== config.ownerID) {message.reply('Heh you can\'t turn me off :P');} else { - message.reply(getBoshyTime(message.guild) + 'AstralQuote is now powering off!'); - console.log('[i] AstralQuote is now powering off...'); - process.exit(0); - } + asyncPowerOff(); + }; } else if (command === 'help') { // This is the new help -- cgit v1.2.3