Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
.env
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
# scramble_bot
<img src="https://img.shields.io/badge/npm-v6.14.14-orange"/>
<img src="https://img.shields.io/badge/node-v14.17.5-brightgreen"/>


discord bot for team scramble

## Installation
---
1. Clone scramble_bot repository
```shell
$ git clone https://github.com/TeamScramble/scramble_bot.git
```
2. move to scramble_bot directory
```shell
$ cd /scramble_bot
```

3. Install dependecies
```shell
$ npm install
```

## Deploy
---
1. compress files to zip
2. Login to AWS console
3. Move to AWS Lambda
4. Make your own lambda function and upload the zip file to it
5. Test uploaded function in AWS Lambda
6. Add your own Trigger with AWS EventBridge
7. Enjoy your Lambda function!


26 changes: 26 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "scramble_bot",
"version": "1.0.0",
"description": "discord bot for team scramble",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/TeamScramble/scramble_bot.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/TeamScramble/scramble_bot/issues"
},
"homepage": "https://github.com/TeamScramble/scramble_bot#readme",
"dependencies": {
"axios": "^0.21.1",
"dotenv": "^10.0.0"
}
}
24 changes: 24 additions & 0 deletions src/dailyScrum.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const axios = require("axios");
require('dotenv').config();


exports.handler = async (event) => {

try {
const result = await axios.post(process.env.DAILYSCRUM_URL, {
"content": "안뇽 :wave: 데일리 스크럼을 해주세요! \n :white_check_mark: 체크인: \n :white_check_mark: 해야할 일: \n :white_check_mark: 협업할 일: \n :white_check_mark: 논의할 일: "
})
console.info("디스코드 웹훅 전송 성공!")
}
catch(err){
console.err("웹훅 실패", err)
}

// TODO implement
const response = {
statusCode: 200,
body: JSON.stringify('daily scrum message from Lambda!'),
};
Comment on lines +17 to +21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO implement는 생략하고,
try catch를 통해 error를 잡았는데 응답코드는 항상 200이 되는게 아닌가 싶어요

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 ~~ 반영해서 수정하도록 하겠습니당. 리뷰감사합니다~~!


return response;
};