From e960b4782a34f52f7f4c3a1ee438a47ed307596d Mon Sep 17 00:00:00 2001 From: gtempus Date: Wed, 1 Nov 2023 22:46:27 -0400 Subject: [PATCH] chore: pass the command to the action --- minecraft-slack-bot/minecraftBot.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/minecraft-slack-bot/minecraftBot.js b/minecraft-slack-bot/minecraftBot.js index 707485e..74cdb45 100644 --- a/minecraft-slack-bot/minecraftBot.js +++ b/minecraft-slack-bot/minecraftBot.js @@ -24,18 +24,12 @@ exports.handler = async (event) => { const secretData = await secretsManager.getSecretValue({ SecretId: 'github_token' }).promise(); const githubToken = JSON.parse(secretData.SecretString).GITHUB_TOKEN; - const commandMapping = { - start: 'running', - stop: 'stopped', - 'status': 'status', - } - // Define the GitHub API endpoint URL const githubApiUrl = 'https://api.github.com/repos/gtempus/minecraft-terraform/dispatches'; const data = JSON.stringify({ "event_type": "custom_event", "client_payload": { - "action": commandMapping[parsedBody.text] + "action": parsedBody.text } }); const config = {