learnmopa.blogg.se

Slack bots
Slack bots













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.















Slack bots