← RSS + Discord Webhook integrations

Send Message With File with Discord Webhook API on New item from multiple RSS feeds from RSS API

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

Trigger workflow on
New item from multiple RSS feeds from the RSS API
Next, do this
Send Message With File with the Discord Webhook API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

This integration creates a workflow with a RSS 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 item from multiple RSS feeds trigger
    1. Connect your RSS account
    2. Configure timer
    3. Configure Feed URLs
  3. Configure the Send Message With File action
    1. Connect your Discord Webhook account
    2. Optional- Configure Message
    3. Optional- Configure Thread ID
    4. Optional- Configure Username
    5. Optional- Configure Avatar URL
    6. Optional- Configure Include link to workflow
    7. Optional- Configure File URL
    8. Optional- Configure File Path
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger

Details

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.

Trigger

Description:Emit new items from multiple RSS feeds
Version:1.0.3
Key:rss-new-item-from-multiple-feeds

Trigger Code

import rss from "../../app/rss.app.mjs";
import { defineSource } from "@pipedream/types";
import rssCommon from "../common/common.mjs";
export default defineSource({
    ...rssCommon,
    key: "rss-new-item-from-multiple-feeds",
    name: "New item from multiple RSS feeds",
    type: "source",
    description: "Emit new items from multiple RSS feeds",
    version: "1.0.3",
    props: {
        ...rssCommon.props,
        urls: {
            propDefinition: [
                rss,
                "urls",
            ],
        },
    },
    dedupe: "unique",
    hooks: {
        async activate() {
            // Try to parse the feed one time to confirm we can fetch and parse.
            // The code will throw any errors to the user.
            for (const url of this.urls) {
                await this.rss.fetchAndParseFeed(url);
            }
        },
    },
    async run() {
        const items = [];
        for (const url of this.urls) {
            const feedItems = await this.rss.fetchAndParseFeed(url);
            items.push(...feedItems);
        }
        this.rss.sortItems(items).forEach((item) => {
            const meta = this.generateMeta(item);
            this.$emit(item, meta);
        });
    },
});

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.
LabelPropTypeDescription
RSSrssappThis component uses the RSS app.
timer$.interface.timer

How often you want to poll the feed for new items

Feed URLsurlsstring[]

Enter either one or multiple URLs from any public RSS feed

Trigger Authentication

The RSS API does not require authentication.

About RSS

Real Simple Syndication

Action

Description:Post a message with an attached file
Version:0.2.0
Key:discord_webhook-send-message-with-file

Action Code

import common from "../send-message-common.mjs";
import axios from "axios";
import fs from "fs";

export default {
  ...common,
  key: "discord_webhook-send-message-with-file",
  name: "Send Message With File",
  description: "Post a message with an attached file",
  version: "0.2.0",
  type: "action",
  props: {
    ...common.props,
    message: {
      propDefinition: [
        common.props.discordWebhook,
        "message",
      ],
      optional: true,
    },
    fileUrl: {
      type: "string",
      label: "File URL",
      description:
        "The URL of the file to attach. Must specify either **File URL** or **File Path**.",
      optional: true,
    },
    filePath: {
      type: "string",
      label: "File Path",
      description:
        "The path to the file, e.g. `/tmp/myFile.csv`. Must specify either **File URL** or **File Path**.",
      optional: true,
    },
  },
  async run({ $ }) {
    const {
      message,
      avatarURL,
      threadID,
      username,
      fileUrl,
      filePath,
      includeSentViaPipedream,
    } = this;

    if (!fileUrl && !filePath) {
      throw new Error("This action requires either File URL or File Path. Please enter one or the other above.");
    }

    const file = fileUrl
      ? (await axios({
        method: "get",
        url: fileUrl,
        responseType: "stream",
      })).data
      : fs.createReadStream(filePath);

    try {
      // No interesting data is returned from Discord
      await this.discordWebhook.sendMessageWithFile({
        avatarURL,
        threadID,
        username,
        file,
        content: includeSentViaPipedream
          ? this.appendPipedreamText(message ?? "")
          : message,
      });
      $.export("$summary", "Message sent successfully");
    } catch (err) {
      const unsentMessage = this.getUserInputProps();
      $.export("unsent", unsentMessage);
      throw err;
    }
  },
};

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.

LabelPropTypeDescription
Discord WebhookdiscordWebhookappThis component uses the Discord Webhook app.
Messagemessagestring

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

Usernameusernamestring

Overrides the current username of the webhook

Avatar URLavatarURLstring

If used, it overrides the default avatar of the webhook

Include link to workflowincludeSentViaPipedreamboolean

Defaults to true, includes a link to this workflow at the end of your Discord message.

File URLfileUrlstring

The URL of the file to attach. Must specify either File URL or File Path.

File PathfilePathstring

The path to the file, e.g. /tmp/myFile.csv. Must specify either File URL or File Path.

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:

webhook.incomingemailidentify

About Discord Webhook

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