프로젝트
GitHub에서 보기
johnagan/serverless-slack-app
소개
OAuth와 봇 액션을 갖춘 Serverless.js Slack 앱 보일러플레이트입니다.
기타 프로젝트측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original
Serverless Slack App Boilerplate
Create a serverless Slack App with AWS Lambda, API Gateway, DynamoDB, and CloudFormation. All services will be automatically provisioned for you. All that's needed is your Slack App keys.
Install Serverless and provision AWS

- Setup your AWS Credentials
- Install Serverless.js
npm install -g serverless
- Install The Serverless Slack App Template and provision all AWS services
serverless install --url https://github.com/johnagan/serverless-slack-app
cd serverless-slack-app
npm install
serverless deploy
Create a Slack App

- Create a new Slack App
- Use the generated POST url for Slack's slash commands, events, and interactive messages
- Update the serverless.yml with your new Slack App keys
| Slack | Serverless |
|---|---|
![]() |
![]() |
Install the Slack App and Test

- Deploy the changes to AWS
serverless deploy - Navigate to the GET url provided from serverless
- Walk through the OAuth flow and install the App
- Goto the team and test the slash command
/greet
Update the Code
// Slash Command handler
slack.on('/greet', (msg, bot) => {
let message = {
text: "How would you like to greet the channel?",
attachments: [{
fallback: 'actions',
callback_id: "greetings_click",
actions: [
{ type: "button", name: "Wave", text: ":wave:", value: ":wave:" },
{ type: "button", name: "Hello", text: "Hello", value: "Hello" },
{ type: "button", name: "Howdy", text: "Howdy", value: "Howdy" },
{ type: "button", name: "Hiya", text: "Hiya", value: "Hiya" }
]
}]
};
// ephemeral reply
bot.replyPrivate(message);
});
// Interactive Message handler
slack.on('greetings_click', (msg, bot) => {
let message = {
// selected button value
text: msg.actions[0].value
};
// public reply
bot.reply(message);
});
- Open the bot source code
- Add/Remove/Update the code with your bot functionality
- Run
serverless deployto deploy your changes to AWS - Rinse and repeat.
All the tokens and urls above were invalidated before posting this tutorial. You will need to use your own tokens
관련 프로젝트 살펴보기
불러오는 중…

