Use this app to create a Discord source that emits messages from your guild to a Pipedream workflow.
Go to siteThe Pipedream Discord app enables you to build event-driven workflows that interact with the Discord API. When you authorize the Pipedream app's access to your guilds, you can use Pipedream workflows to perform common Discord actions, or write your own code against the Discord API.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
discord: {
type: "app",
app: "discord",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://discord.com/api/users/@me`,
headers: {
Authorization: `Bearer ${this.discord.$auth.oauth_access_token}`,
"accept": `application/json`,
},
})
},
})
You can install the Pipedream Discord app in the Accounts section of your account, or directly in a workflow.
Not sure if you need to use the Discord or the Discord Bot integration for your workflow? Here's are the general similarities and differences:
Discord and Discord Bot actions and triggers can both:
However the Discord integration will perform actions with the official Pipedream Discord bot.
Using the Discord Bot integration will use a custom bot instead, with it's own name and photo.
If you have issues with this integration, please join our public Slack and ask for help.
Discord uses OAuth authentication. When you connect your Discord account, Pipedream will open a popup window where you can sign into Discord 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 API.
Pipedream requests the following authorization scopes when you connect your account:
bot
email
identify
guilds
GET
https://discord.com/oauth2/authorize
?
client_id={{oauth.client_id}}
&
redirect_uri={{oauth.redirect_uri}}
&
state={{oauth.state}}
&
response_type=code
&
scope={{oauth.space_separated_scopes}}
&
prompt=consent
&
permissions=8
POST
https://discord.com/api/oauth2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
redirect_uri={{oauth.redirect_uri}}
&
grant_type=authorization_code
&
code={{oauth.code}}
POST
https://discord.com/api/oauth2/token
content-type: application/x-www-form-urlencoded
accept: application/json
client_id={{oauth.client_id}}
&
client_secret={{oauth.client_secret}}
&
grant_type=refresh_token
&
refresh_token={{oauth.refresh_token}}