From 8fc98efe55c145d9a79865fed3693f6559c4fbf9 Mon Sep 17 00:00:00 2001 From: Emily J Date: Thu, 29 Oct 2020 20:23:34 +1100 Subject: [PATCH] new restart command x2 --- src/commands/restart.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/restart.js b/src/commands/restart.js index 3731fe6..fb174fc 100644 --- a/src/commands/restart.js +++ b/src/commands/restart.js @@ -7,12 +7,12 @@ exports.run = (client, message) => {// eslint-disable-line no-unused-vars message.channel.send("<:reboot:467216876938985482> Restarting..."); client.destroy(); - client.wait(); + require("util").promisify(setTimeout); fetch('https://gamecp.apex.to/api/client/servers/1fc76afa-9a4d-497b-983a-a898795ab5b5/power', { method: 'post', - body: { 'signal': 'restart' }, - headers: { 'Authorization': `Bearer ${client.config.server}` } + body: JSON.stringify({ 'signal': 'restart' }), + headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${client.config.server}` } }); };