Skip to content

Commit bc03704

Browse files
committed
make channel configurable
1 parent f1ab7ed commit bc03704

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

env/server.ts

+1
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@ export const serverEnv = {
6767
CLOUDINARY_API_SECRET: cloudinaryParser({ allowEmpty: true, default: '' }),
6868
ENABLE_SLACK_POSTING: bool({ default: false }),
6969
SLACK_TOKEN: slackParser({ allowEmpty: true, default: '' }),
70+
SLACK_CHANNEL: slackParser({ allowEmpty: true, default: '#general' }),
7071
}),
7172
}

lib/slack.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export async function postToSlackIfEnabled({
1616

1717
const web = new WebClient(serverEnv.SLACK_TOKEN)
1818
return await web.chat.postMessage({
19-
channel: '#mike-test',
19+
channel: serverEnv.SLACK_CHANNEL,
2020
text: `*<${serverEnv.NEXT_APP_URL}/post/${post.id}|${post.title}>*`,
2121
blocks: [
2222
{

0 commit comments

Comments
 (0)