Skip to content

Commit

Permalink
refactor: rename socket mode to slack dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukaii committed Mar 2, 2023
1 parent 560b16d commit 6e4cb39
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
SLACK_WEBHOOK=
SLACK_APP_TOKEN=
# enable socket mode for dev
ENABLE_SOCKET_MODE_FOR_DEV=false
SLACK_DEV_MODE=false
SLACK_STATE_SECRET=ZpfmpL2LWpMnbnsP4RGpLAY2dFirKNiv2dC/LtNGv8g=
SLACK_CLIENT_ID=
SLACK_CLIENT_SECRET=

Expand Down
3 changes: 2 additions & 1 deletion lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ export const config = {
slackAppToken: process.env.SLACK_APP_TOKEN,
slackBotToken: process.env.SLACK_BOT_TOKEN,
slackSigningSecret: process.env.SLACK_SIGNING_SECRET,
enableSocketModeForDev: process.env.ENABLE_SOCKET_MODE_FOR_DEV === "true",
slackDevMode: process.env.SLACK_DEV_MODE === "true",
slackClientId: process.env.SLACK_CLIENT_ID,
slackClientSecret: process.env.SLACK_CLIENT_SECRET,
slackStateSecret: process.env.SLACK_STATE_SECRET,

apiSecret,
tokenLine,
Expand Down
2 changes: 1 addition & 1 deletion pages/api/slack/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
return;
}

if (applicationConfig.enableSocketModeForDev) {
if (applicationConfig.slackDevMode) {
return res.status(200).json({ ok: true });
} else {
await appRunner?.handleEvents(req, res);
Expand Down

0 comments on commit 6e4cb39

Please sign in to comment.