From f03314af80118751d69150a2f1183c5002b31da4 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sun, 19 Feb 2023 19:06:16 -0500 Subject: [PATCH] Restructured file to allow async use --- modules/_deploy-global.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/_deploy-global.js b/modules/_deploy-global.js index 33c6d6b..3d90514 100755 --- a/modules/_deploy-global.js +++ b/modules/_deploy-global.js @@ -22,7 +22,7 @@ console.log(`Token: ${token} Client ID: ${clientId}`); const rest = new REST({ version: '9' }).setToken(token); -(async () => { +async function deleteCommands() { try { console.log('Started deleting application (/) commands.'); @@ -35,11 +35,11 @@ const rest = new REST({ version: '9' }).setToken(token); } catch (error) { console.error(error); } -})(); +} -(async () => { +async function uploadCommands() { try { - console.log('Started refreshing application (/) commands.'); + console.log('Started reloading application (/) commands.'); await rest.put( Routes.applicationCommands(clientId), @@ -51,4 +51,9 @@ const rest = new REST({ version: '9' }).setToken(token); } catch (error) { console.error(error); } +} + +(async () => { + await deleteCommands(); + await uploadCommands(); })(); \ No newline at end of file