7/10/2023 0 Comments Slack news![]() Scroll down to "Scopes", and add the following scopes under "Bot Token Scopes": Step 4: Configuring Slack appįor your Slack app to be able to send/unfurl messages in your Slack workspace, we will need to configure a few things:Step 4A: Configuring OAuth Scopesįrom your Slack app home screen, select "OAuth & Permissions" from the sidebar (under "Features"). When the project finishes deploying, get your project's domain (e.g. You can deploy your bot to Vercel with one-click:īe sure to include all 5 of the env vars above in your deployment. It will be the value for the SLACK_VERIFICATION_TOKEN env var. Verification Token: This is the verification token used to validate that requests are genuinely coming from Slack.It will be the value for the SLACK_SIGNING_SECRET env var. Signing Secret: This is the signing secret used to validate that requests are genuinely coming from Slack.Client ID: This is your App's unique public-facing ID that will be the value for the NEXT_PUBLIC_SLACK_CLIENT_ID env var.Here, you'll receive 3 values that will be used for your Vercel deployment in the next step: Voilà! You've just created your Slack app.Select "From scratch" and input Hacker News Bot as the name of your app.Navigate to /apps and click on "Create New App".Step 1: Create Slack App + Secure Env Vars Prefer a video tutorial instead? Watch this video. Note that while this is in early-access, some of these processes might change. You can also deploy your own version of this bot using Vercel and Upstash. Once it's installed, create a channel to receive notifications in and start configuring the bot with the /configure command. You can click the button below to install the bot directly into your desired Slack workspace: Here's a 60s video that walks you through the installation process, step-by-step. Once an event occurs, send a POST request to Slack to unfurl the link using the chat.unfurl method. Listen to the link_shared event at our /api/event endpoint.For each positive post, send its link to Slack using the chat.postMessage method.Then, perform checks against each post between lastCheckedId and latestPostId to see if they contain any of the delineated keywords. Get the latestPostId using HN API's maxitem endpoint.Get the last checked HN post ID ( lastCheckedId) and the list of keywords to check against from Upstash.Set up a Vercel cron job that pings our /api/cron endpoint once every 60 seconds.Upstash for key-value storage ( Redis).Slack API for sending and unfurling messages.Vercel Cron Jobs for triggering cron processes.Vercel Functions for cron processes & event subscriptions via webhooks.
0 Comments
Leave a Reply. |