diff --git a/server/notion/blog/notionPage/handleBlogUploadSubmission.ts b/server/notion/blog/notionPage/handleBlogUploadSubmission.ts index 342f134..61daea8 100644 --- a/server/notion/blog/notionPage/handleBlogUploadSubmission.ts +++ b/server/notion/blog/notionPage/handleBlogUploadSubmission.ts @@ -1,6 +1,6 @@ import { SlackViewAction, ViewOutput } from "@slack/bolt"; import { uploadBlogToNotion } from "./uploadBlogToNotion"; -import { WebClient } from "@slack/web-api"; + export async function handlerBlogUploadSubmission(body: SlackViewAction, view: ViewOutput, client: any){ const userId = body.user.id; const slackUserInfo = await client.users.info({user: userId}); diff --git a/serverless.yml b/serverless.yml index 9fdae1c..a349144 100644 --- a/serverless.yml +++ b/serverless.yml @@ -16,7 +16,6 @@ provider: TEAM_JOON_CHANNEL: ${env:TEAM_JOON_CHANNEL} DEBUG_CHANNEL: ${env:DEBUG_CHANNEL} - functions: slackBotHandler: handler: dist/utils/function/lambdaHandler/handler.handler @@ -31,6 +30,13 @@ functions: - httpApi: method: POST path: /slack/uploadNotion + - schedule: + rate: rate(1 hour) + enabled: true + input: + detail-type: "ScheduledEvent" + source: "aws.events" + detail: {} SendBlogInfoToSlackSchedule: handler: dist/scheduler/sendBlogInfoToSlackChannel.handler timeout: 20