← Discord Bot + Zoom Admin integrations

Create Webinar with Zoom Admin API on New Message in Channel from Discord Bot API

Pipedream makes it easy to connect APIs for Zoom Admin, Discord Bot and 800+ other apps remarkably fast.

Trigger workflow on
New Message in Channel from the Discord Bot API
Next, do this
Create Webinar with the Zoom Admin 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 Discord Bot trigger and Zoom Admin 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 Message in Channel trigger
    1. Connect your Discord Bot account
    2. Select a Guild
    3. Select one or more Channels
    4. Optional- Configure Emit messages as a single event
    5. Configure timer
  3. Configure the Create Webinar action
    1. Connect your Zoom Admin account
    2. Optional- Configure Name
    3. Select a Recurrence Type
    4. Optional- Configure Start Time
    5. Optional- Configure Duration
    6. Optional- Select a Timezone
    7. Optional- Configure Password
  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 event for each message posted to one or more channels
Version:0.0.5
Key:discord_bot-new-message-in-channel

Trigger Code

import maxBy from "lodash.maxby";
import common from "../common.mjs";

const { discord } = common.props;

export default {
  ...common,
  key: "discord_bot-new-message-in-channel",
  name: "New Message in Channel",
  description: "Emit new event for each message posted to one or more channels",
  type: "source",
  version: "0.0.5",
  dedupe: "unique", // Dedupe events based on the Discord message ID
  props: {
    ...common.props,
    db: "$.service.db",
    channels: {
      type: "string[]",
      label: "Channels",
      description: "The channels you'd like to watch for new messages",
      propDefinition: [
        discord,
        "channelId",
        ({ guildId }) => ({
          guildId,
        }),
      ],
    },
    emitEventsInBatch: {
      type: "boolean",
      label: "Emit messages as a single event",
      description:
        "If `true`, all messages are emitted as an array, within a single Pipedream event. Defaults to `false`, emitting each Discord message as its own event in Pipedream",
      optional: true,
      default: false,
    },
    timer: {
      type: "$.interface.timer",
      default: {
        intervalSeconds: 60 * 15,
      },
    },
  },
  async run({ $ }) {
    // We store a cursor to the last message ID
    let lastMessageIDs = this._getLastMessageIDs();

    // If this is our first time running this source,
    // get the last N messages, emit them, and checkpoint
    for (const channelId of this.channels) {
      let lastMessageID;
      let messages = [];

      if (!lastMessageID) {
        messages = await this.discord.getMessages({
          $,
          channelId,
          params: {
            limit: 100,
          },
        });

        lastMessageID = messages.length
          ? maxBy(messages, (message) => message.id).id
          : 1;

      } else {
        let newMessages = [];

        do {
          newMessages = await this.discord.getMessages({
            $,
            channelId,
            params: {
              after: lastMessageIDs[channelId],
            },
          });

          messages = messages.concat(newMessages);

          lastMessageID = newMessages.length
            ? maxBy(newMessages, (message) => message.id).id
            : lastMessageIDs[channelId];

        } while (newMessages.length);
      }

      // Set the new high water mark for the last message ID
      // for this channel
      lastMessageIDs[channelId] = lastMessageID;

      if (!messages.length) {
        console.log(`No new messages in channel ${channelId}`);
        return;
      }

      console.log(`${messages.length} new messages in channel ${channelId}`);

      // Batched emits do not take advantage of the built-in deduper
      if (this.emitEventsInBatch) {
        const suffixChar =
          messages.length > 1
            ? "s"
            : "";

        this.$emit(messages, {
          summary: `${messages.length} new message${suffixChar}`,
          id: lastMessageID,
        });

      } else {
        messages.forEach((message) => {
          this.$emit(message, {
            summary: message.content,
            id: message.id, // dedupes events based on this ID
          });
        });
      }
    }

    // Set the last message ID for the next run
    this._setLastMessageIDs(lastMessageIDs);
  },
};

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
Discord BotdiscordappThis component uses the Discord Bot app.
GuildguildIdstringSelect a value from the drop down menu.
N/Adb$.service.dbThis component uses $.service.db to maintain state between component invocations.
Channelschannelsstring[]Select a value from the drop down menu.
Emit messages as a single eventemitEventsInBatchboolean

If true, all messages are emitted as an array, within a single Pipedream event. Defaults to false, emitting each Discord message as its own event in Pipedream

timer$.interface.timer

Trigger Authentication

Discord Bot uses API keys for authentication. When you connect your Discord Bot account, Pipedream securely stores the keys so you can easily authenticate to Discord Bot APIs in both code and no-code steps.

This integration allows you to use the Discord API using your own Discord bot. If you don't use a custom bot, and you just need to use the Discord API, exit this screen and use the Discord integration, instead.


If you want to use your own Discord bot, but haven't created one yet, see these instructions or watch this video. You'll need to add this bot to your server(s) to make successful API requests.

Once you've created your bot, you'll find the Bot token within the Bot section of your app. Enter that token below.

About Discord Bot

Use this app to interact with the Discord API using a bot in your account

Action

Description:Create a webinar for an user. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarcreate)
Version:0.0.1
Key:zoom_admin-action-create-a-webinar

Action Code

import zoomAdmin from "../../zoom_admin.app.mjs";
import tzs from "../../zoom_tzs.mjs";
import consts from "../../consts.mjs";
import { axios } from "@pipedream/platform";

const { RECURRENCE_TYPE_OPTIONS } = consts;

export default {
  name: "Create Webinar",
  description: "Create a webinar for an user. [See the docs here](https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarcreate)",
  key: "zoom_admin-action-create-a-webinar",
  version: "0.0.1",
  type: "action",
  props: {
    zoomAdmin,
    topic: {
      type: "string",
      label: "Name",
      description: "The Webinar's topic.",
      optional: true,
    },
    recurrenceType: {
      type: "integer",
      label: "Recurrence Type",
      description: "Recurrence webinar types",
      options: RECURRENCE_TYPE_OPTIONS,
    },
    startTime: {
      type: "string",
      label: "Start Time",
      description: "The webinar start time. We support two formats for this field - local time and GMT. To set time as GMT the format should be `yyyy-MM-ddTHH:mm:ssZ`. To set time using a specific timezone, use `yyyy-MM-ddTHH:mm:ss` format and specify the timezone ID in the `timezone` field.",
      optional: true,
    },
    duration: {
      type: "integer",
      label: "Duration",
      description: "The webinar’s duration, in minutes. This field is only used for scheduled webinars.",
      optional: true,
    },
    timezone: {
      type: "string",
      label: "Timezone",
      description: "The timezome to assign to the `startTime`. This field is only used for scheduled webinars.",
      options: tzs,
      optional: true,
    },
    password: {
      type: "string",
      label: "Password",
      description: "The password required to join the webinar. By default, a password can only have a maximum length of `10` characters and only contain alphanumeric characters and the `@`, `-`, `_` and `*` characters.",
      optional: true,
    },
  },
  async run ({ $ }) {
    const data = {
      topic: this.topic,
      start_time: this.startTime,
      duration: this.duration,
      password: this.password,
      timezone: this.timezone,
      recurrence: {
        type: this.recurrenceType,
      },
    };
    const res = await axios($, this.zoomAdmin._getAxiosParams({
      method: "POST",
      path: "/users/me/webinars",
      data,
    }));

    $.export("$summary", `The webinar, "${this.topic}," was successfully created`);

    return res;
  },
};

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
Zoom AdminzoomAdminappThis component uses the Zoom Admin app.
Nametopicstring

The Webinar's topic.

Recurrence TyperecurrenceTypeintegerSelect a value from the drop down menu:{ "label": "Daily", "value": 1 }{ "label": "Weekly", "value": 2 }{ "label": "Monthly", "value": 3 }
Start TimestartTimestring

The webinar start time. We support two formats for this field - local time and GMT. To set time as GMT the format should be yyyy-MM-ddTHH:mm:ssZ. To set time using a specific timezone, use yyyy-MM-ddTHH:mm:ss format and specify the timezone ID in the timezone field.

Durationdurationinteger

The webinar’s duration, in minutes. This field is only used for scheduled webinars.

TimezonetimezonestringSelect a value from the drop down menu:{ "label": "Adelaide", "value": "Australia/Adelaide" }{ "label": "Aden", "value": "Asia/Aden" }{ "label": "Alaska", "value": "America/Anchorage" }{ "label": "Algiers", "value": "Africa/Algiers" }{ "label": "Almaty", "value": "Asia/Almaty" }{ "label": "Amman", "value": "Asia/Amman" }{ "label": "Amsterdam", "value": "Europe/Amsterdam" }{ "label": "Amsterdam, Berlin, Rome, Stockholm, Vienna", "value": "Europe/Berlin" }{ "label": "Arizona", "value": "America/Phoenix" }{ "label": "Astana, Dhaka", "value": "Asia/Dhaka" }{ "label": "Athens", "value": "Europe/Athens" }{ "label": "Atlantic Time (Canada)", "value": "Canada/Atlantic" }{ "label": "Auckland, Wellington", "value": "Pacific/Auckland" }{ "label": "Azores", "value": "Atlantic/Azores" }{ "label": "Baghdad", "value": "Asia/Baghdad" }{ "label": "Bahrain", "value": "Asia/Bahrain" }{ "label": "Baku, Tbilisi, Yerevan", "value": "Asia/Baku" }{ "label": "Bangkok", "value": "Asia/Bangkok" }{ "label": "Beijing, Shanghai", "value": "Asia/Shanghai" }{ "label": "Beirut", "value": "Asia/Beirut" }{ "label": "Belgrade, Bratislava, Ljubljana", "value": "Europe/Belgrade" }{ "label": "Bogota", "value": "America/Bogota" }{ "label": "Brasilia", "value": "America/Araguaina" }{ "label": "Brisbane", "value": "Australia/Brisbane" }{ "label": "Brussels", "value": "Europe/Brussels" }{ "label": "Bucharest", "value": "Europe/Bucharest" }{ "label": "Budapest", "value": "Europe/Budapest" }{ "label": "Buenos Aires, Georgetown", "value": "America/Argentina/Buenos_Aires" }{ "label": "Cairo", "value": "Africa/Cairo" }{ "label": "Canberra, Melbourne, Sydney", "value": "Australia/Sydney" }{ "label": "Cape Verde Islands", "value": "Atlantic/Cape_Verde" }{ "label": "Caracas", "value": "America/Caracas" }{ "label": "Casablanca", "value": "Africa/Casablanca" }{ "label": "Central Time (US and Canada)", "value": "America/Chicago" }{ "label": "Copenhagen", "value": "Europe/Copenhagen" }{ "label": "Costa Rica", "value": "America/Costa_Rica" }{ "label": "Dacca", "value": "Asia/Dacca" }{ "label": "Damascus", "value": "Asia/Damascus" }{ "label": "Darwin", "value": "Australia/Darwin" }{ "label": "Djibouti", "value": "Africa/Djibouti" }{ "label": "Dubai", "value": "Asia/Dubai" }{ "label": "Dublin", "value": "Europe/Dublin" }{ "label": "Eastern Time (US and Canada)", "value": "America/New_York" }{ "label": "Edmonton", "value": "America/Edmonton" }{ "label": "El Salvador", "value": "America/El_Salvador" }{ "label": "Fiji Islands, Marshall Islands", "value": "Pacific/Fiji" }{ "label": "Greenland", "value": "America/Godthab" }{ "label": "Greenwich Mean Time", "value": "Etc/Greenwich" }{ "label": "Guam, Port Moresby", "value": "Pacific/Port_Moresby" }{ "label": "Guatemala", "value": "America/Guatemala" }{ "label": "Halifax", "value": "America/Halifax" }{ "label": "Harare, Pretoria", "value": "Africa/Harare" }{ "label": "Hawaii", "value": "Pacific/Honolulu" }{ "label": "Helsinki", "value": "Europe/Helsinki" }{ "label": "Hobart", "value": "Australia/Hobart" }{ "label": "Hong Kong", "value": "Asia/Hong_Kong" }{ "label": "Independent State of Samoa", "value": "Pacific/Apia" }{ "label": "India", "value": "Asia/Calcutta" }{ "label": "Indiana (East)", "value": "America/Indianapolis" }{ "label": "Irkutsk, Ulaanbaatar", "value": "Asia/Irkutsk" }{ "label": "Islamabad, Karachi, Tashkent", "value": "Asia/Tashkent" }{ "label": "Istanbul", "value": "Europe/Istanbul" }{ "label": "Jakarta", "value": "Asia/Jakarta" }{ "label": "Jerusalem", "value": "Asia/Jerusalem" }{ "label": "Johannesburg", "value": "Africa/Johannesburg" }{ "label": "Kabul", "value": "Asia/Kabul" }{ "label": "Kamchatka", "value": "Asia/Kamchatka" }{ "label": "Kathmandu", "value": "Asia/Kathmandu" }{ "label": "Khartoum", "value": "Africa/Khartoum" }{ "label": "Kiev", "value": "Europe/Kiev" }{ "label": "Krasnoyarsk", "value": "Asia/Krasnoyarsk" }{ "label": "Kuala Lumpur", "value": "Asia/Kuala_Lumpur" }{ "label": "Kuwait", "value": "Asia/Kuwait" }{ "label": "Lima", "value": "America/Lima" }{ "label": "Lisbon", "value": "Europe/Lisbon" }{ "label": "London", "value": "Europe/London" }{ "label": "Luxembourg", "value": "Europe/Luxembourg" }{ "label": "Madrid", "value": "Europe/Madrid" }{ "label": "Magadan", "value": "Asia/Magadan" }{ "label": "Managua", "value": "America/Managua" }{ "label": "Mazatlan", "value": "America/Mazatlan" }{ "label": "Mexico City", "value": "America/Mexico_City" }{ "label": "Midway Island, Samoa", "value": "Pacific/Midway" }{ "label": "Mogadishu", "value": "Africa/Mogadishu" }{ "label": "Montevideo", "value": "America/Montevideo" }{ "label": "Montreal", "value": "America/Montreal" }{ "label": "Moscow", "value": "Europe/Moscow" }{ "label": "Mountain Time (US and Canada)", "value": "America/Denver" }{ "label": "Mumbai, Kolkata, New Delhi", "value": "Asia/Kolkata" }{ "label": "Muscat", "value": "Asia/Muscat" }{ "label": "Nairobi", "value": "Africa/Nairobi" }{ "label": "New Caledonia", "value": "Pacific/Noumea" }{ "label": "Newfoundland and Labrador", "value": "America/St_Johns" }{ "label": "Nicosia", "value": "Asia/Nicosia" }{ "label": "Nouakchott", "value": "Africa/Nouakchott" }{ "label": "Novosibirsk", "value": "Asia/Novosibirsk" }{ "label": "Osaka, Sapporo, Tokyo", "value": "Asia/Tokyo" }{ "label": "Oslo", "value": "Europe/Oslo" }{ "label": "Pacific Time (US and Canada)", "value": "America/Los_Angeles" }{ "label": "Pago Pago", "value": "Pacific/Pago_Pago" }{ "label": "Panama", "value": "America/Panama" }{ "label": "Paris", "value": "Europe/Paris" }{ "label": "Perth", "value": "Australia/Perth" }{ "label": "Prague Bratislava", "value": "Europe/Prague" }{ "label": "Puerto Rico", "value": "America/Puerto_Rico" }{ "label": "Qatar", "value": "Asia/Qatar" }{ "label": "Reykjavik", "value": "Atlantic/Reykjavik" }{ "label": "Riyadh", "value": "Asia/Riyadh" }{ "label": "Rome", "value": "Europe/Rome" }{ "label": "Santiago", "value": "America/Santiago" }{ "label": "Sao Paulo", "value": "America/Sao_Paulo" }{ "label": "Sarajevo, Skopje, Zagreb", "value": "CET" }{ "label": "Saskatchewan", "value": "America/Regina" }{ "label": "Seoul", "value": "Asia/Seoul" }{ "label": "Singapore", "value": "Asia/Singapore" }{ "label": "Sofia", "value": "Europe/Sofia" }{ "label": "Solomon Islands", "value": "SST" }{ "label": "Stockholm", "value": "Europe/Stockholm" }{ "label": "Taipei", "value": "Asia/Taipei" }{ "label": "Tegucigalpa", "value": "America/Tegucigalpa" }{ "label": "Tehran", "value": "Asia/Tehran" }{ "label": "Tijuana", "value": "America/Tijuana" }{ "label": "Tripoli", "value": "Africa/Tripoli" }{ "label": "Tunis", "value": "Africa/Tunis" }{ "label": "Universal Time UTC", "value": "UTC" }{ "label": "Vancouver", "value": "America/Vancouver" }{ "label": "Vienna", "value": "Europe/Vienna" }{ "label": "Vietnam", "value": "Asia/Saigon" }{ "label": "Vladivostok", "value": "Asia/Vladivostok" }{ "label": "Warsaw", "value": "Europe/Warsaw" }{ "label": "West Central Africa", "value": "Africa/Bangui" }{ "label": "Winnipeg", "value": "America/Winnipeg" }{ "label": "Yakutsk", "value": "Asia/Yakutsk" }{ "label": "Yekaterinburg", "value": "Asia/Yekaterinburg" }{ "label": "Zurich", "value": "Europe/Zurich" }
Passwordpasswordstring

The password required to join the webinar. By default, a password can only have a maximum length of 10 characters and only contain alphanumeric characters and the @, -, _ and * characters.

Action Authentication

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

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

About Zoom Admin

Video conferencing (includes account-level scopes)

More Ways to Connect Zoom Admin + Discord Bot