-
Notifications
You must be signed in to change notification settings - Fork 0
#001 디스코드 데일리 스크럼 봇을 생성한다 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
warmwhiten
wants to merge
3
commits into
main
Choose a base branch
from
feat/1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| /node_modules | ||
| .env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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! | ||
|
|
||
|
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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!'), | ||
| }; | ||
|
|
||
| return response; | ||
| }; | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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이 되는게 아닌가 싶어요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오호 ~~ 반영해서 수정하도록 하겠습니당. 리뷰감사합니다~~!