Skip to content

Commit

Permalink
chore: pass the command to the action
Browse files Browse the repository at this point in the history
  • Loading branch information
gtempus committed Nov 2, 2023
1 parent 1e58f82 commit e960b47
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions minecraft-slack-bot/minecraftBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit e960b47

Please sign in to comment.