Copy of Send messages to Discord via webhook in <5 mins
@click-helper
code:
data:privatelast updated:5 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
quickstart
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
7
8
9
10
11
12
}
13
/*
1. Copy this workflow to run it for free
2. Connect your Discord account
3. Deploy and send a test event

Check your Discord channel for a message! 

Next, customize this workflow using any NodeJS and send live 
webhook or HTTP traffic to the workflow endpoint URL generated 
by Pipedream to run it!
*/
steps.
generate_message
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
}
7
// Write any NodeJS here to process the incoming event.
// You must return a string -- that value will be sent 
// to Discord in the next step.

return `The A-Level Physics server is, because of Wuhan Flu, the means of education to the A-Level students during the outbreak. Until the Coronavirus has been contained, we will continue using the A-Level Physics server.`
steps.
send_message
Send a message to the channel tied to your incoming webhook
auth
(auths.discord_webhook)
params
Message
{{steps.generate_message.$return_value}}
string ·params.message
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
}
16
const axios = require("axios")
const url = auths.discord_webhook.oauth_uid
let content = params.message

return await require("@pipedreamhq/platform").axios(this, {
  method: "POST",
  url,
  headers: {
    "Content-Type": "application/json"
  },
  data: {
    content
  }
})
steps.
about_pipedream
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
}
18
/*
Integrate with 100+ apps and 1000+ APIs for free:

- Run code on each event using NodeJS and NPM

- Auth apps and APIs with a click and use keys 
and oauth tokens in code (e.g., to send data to 
Google Sheets, Airtable or Slack)

- Trigger your code via a unique pipedream.net 
URL or email addresses, custom schedules or by 
integrating the Pipedream SDK into your app

- No infrastructure to manage -- everything
runs on Pipedream's servers!
*/