← Hacker News + Discord Webhook integrations

Send Message (Advanced) with Discord Webhook APIon New Comments by Keyword from Hacker News API

Pipedream makes it easy to connect APIs for Discord Webhook, Hacker News and + other apps remarkably fast.

Trigger workflow on
New Comments by Keyword from the Hacker News API
Next, do this
Send Message (Advanced) with the Discord Webhook API
No credit card required
Trusted by 200,000+ developers from startups to Fortune 500 companies:
Trusted by 200,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

This integration creates a workflow with a Hacker News trigger and Discord Webhook action. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Select this integration
  2. Configure the New Comments by Keyword trigger
    1. Connect your Hacker News account
    2. Configure timer
    3. Optional- Configure Keyword
  3. Configure the Send Message (Advanced) action
    1. Connect your Discord Webhook account
    2. Optional- Configure message
    3. Optional- Configure Thread ID
    4. Optional- Configure embeds
    5. Optional- Configure username
    6. Optional- Configure Avatar URL
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger


This integration uses pre-built, open source components from Pipedream's GitHub repo. These components are developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.


Description:Emit new comments that mention a specific keyword

Trigger Code

const Parser = require("rss-parser")
const parser = new Parser()

const hacker_news = require('../../hacker_news.app.js')

module.exports = {
  key: "hacker_news-new-comments-by-keyword",
  name: "New Comments by Keyword",
  description: "Emit new comments that mention a specific keyword",
  app: "hacker_news",
  version: "0.0.3",
  props: {
    timer: {
      type: "$.interface.timer",
      default: {
        intervalSeconds: 15,
    db: "$.service.db",
    // If you want a single search feed but multiple keywords, separate the keywords with " OR ":
    keyword: {
      type: "string", 
      label: "Keyword",
      description: "Keyword to watch. Matches comments. Leave blank to get all comments.",
      optional: true,
      default: "",
  methods: {
    // in theory if alternate setting title and description or aren't unique this won't work
    itemKey(item) {
      return item.guid || item.id || item.title || item.description
  async run() {
    const seenKeys = this.db.get("seenKeys") || []
    const seenKeysMap = seenKeys.reduce((acc, v) => {
      acc[v] = true
      return acc
    }, {})
    // All elements of an item are optional, however at least one of title or description must be present.
    // should be listed from most recent to least recent
    const feed = await parser.parseURL(`https://hnrss.org/newcomments?q=${encodeURIComponent(this.keyword)}`)
    for (let idx = feed.items.length - 1; idx >= 0; idx--) {
      const item = feed.items[idx]
      const key = this.itemKey(item)
      // XXX throw if !key?
      if (seenKeysMap[key]) continue
      seenKeysMap[key] = true // just in case of dupes
      this.$emit(item, {
        id: this.itemKey(item),
        summary: item.title,
        ts: item.pubdate && +new Date(item.pubdate), 
    if (seenKeys.length) {
      // XXX restrict by byte size instead of el size
      this.db.set("seenKeys", seenKeys.slice(0, 1000))

Trigger Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
Hacker Newshacker_newsappThis component uses the Hacker News app.
N/Adb$.service.dbThis component uses $.service.db to maintain state between component invocations.

Keyword to watch. Matches comments. Leave blank to get all comments.

Trigger Authentication

The Hacker News API does not require authentication.

About Hacker News

Social news website


Description:Send a simple or structured message (using embeds) to a Discord channel

Action Code

const discordWebhook = require("../../discord_webhook.app.js");

module.exports = {
  key: "discord_webhook-send-message-advanced",
  name: "Send Message (Advanced)",
  description: "Send a simple or structured message (using embeds) to a Discord channel",
  version: "0.1.4",
  type: "action",
  props: {
    message: {
      propDefinition: [
      optional: true,
    threadID: {
      propDefinition: [
    embeds: {
      propDefinition: [
    username: {
      propDefinition: [
    avatarURL: {
      propDefinition: [
  async run() {
    const content = this.message;
    const {
    } = this;

    if (!content && !embeds) {
      throw new Error("This action requires at least 1 message OR embeds object. Please enter one or the other above.");

    // No interesting data is returned from Discord
    await this.discordWebhook.sendMessage({

Action Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI.

Discord WebhookdiscordWebhookappThis component uses the Discord Webhook app.

Enter a simple message up to 2000 characters. This is the most commonly used field. However, it's optional if you pass embed content.

Thread IDthreadIDstring

If provided, the message will be posted to this thread


Optionally pass an array of embed objects. E.g., {{ [{"description":"Use markdown including *Italic* **bold** __underline__ ~~strikeout~~ [hyperlink](https://google.com) `code`"}] }}. To pass data from another step, enter a reference using double curly brackets (e.g., {{steps.mydata.$return_value}}).
Tip: Construct the embeds array in a Node.js code step, return it, and then pass the return value to this step.


Overrides the current username of the webhook

Avatar URLavatarURLstring

If used, it overrides the default avatar of the webhook

Action Authentication

Discord Webhook uses OAuth authentication. When you connect your Discord Webhook account, Pipedream will open a popup window where you can sign into Discord Webhook and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Discord Webhook API.

Pipedream requests the following authorization scopes when you connect your account:


About Discord Webhook

Use this app to send messages to a channel using Discord's incoming webhooks

About Pipedream

Stop writing boilerplate code, struggling with authentication and managing infrastructure. Start connecting APIs with code-level control when you need it — and no code when you don't.

Into to Pipedream
Watch us build a workflow
Watch us build a workflow
4 min
Watch now ➜
"The past few weeks, I truly feel like the clichéd 10x engineer."
Powerful features that scale
Manage concurrency and execution rate
Manage concurrency and execution rate

Queue up to 10,000 events per workfow and manage the concurrency and rate at which workflows are triggered.

Process large payloads up to 5 terabytes
Process large payloads up to 5 terabytes

Large file support enables you to trigger workflows with any data (e.g., large JSON files, images and videos) up to 5 terabytes.

Return custom responses to HTTP requests
Return custom responses to HTTP requests

Return any JSON-serializable response from an HTTP triggered workflow using $respond().

Use most npm packages
Use most npm packages

To use any npm package, just require() it -- there's no npm install or package.json required.

Maintain state between executions
Maintain state between executions

Use $checkpoint to save state in one workflow invocation and read it the next time your workflow runs.

Pass data between steps
Pass data between steps

Return data from any step to inspect it in a human-friendly way and reference the data in future steps via the steps object.