Integrations / Discord
Discord
Community chat: read the connected profile and servers, and post to the channel the user chose.
4 actions
OAuth 2
3 read1 write
Calls discord.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "discord" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
| Scope | Why it is requested |
|---|---|
identify | Read your Discord username and avatar |
guilds | See which servers you are in |
guilds.members.read | Read your member profile inside a server |
webhook.incoming | Post messages to the one channel you choose |
Actions
Get server memberreaddiscord.get_guild_memberGet the user's member profile in one server.
Needs scope: guilds.members.read
| Input | Type | Description | |
|---|---|---|---|
guild_id | string | Required |
await setu.execute({
userId: "user_1",
action: "discord.get_guild_member",
input: {
"guild_id": "<guild_id>"
},
});Get current userreaddiscord.get_meGet the connected Discord user's profile.
Needs scope: identify
No input.
await setu.execute({
userId: "user_1",
action: "discord.get_me",
input: {},
});List serversreaddiscord.list_guildsList the Discord servers the user belongs to.
Needs scope: guilds
No input.
await setu.execute({
userId: "user_1",
action: "discord.list_guilds",
input: {},
});Send messagewritediscord.send_messagePost a message to the Discord channel the user chose when connecting.
Needs scope: webhook.incoming
| Input | Type | Description | |
|---|---|---|---|
content | string | Required | Message text, up to 2000 characters |
username | string | Optional | Optional display name for this message |
await setu.execute({
userId: "user_1",
action: "discord.send_message",
input: {
"content": "<content>"
},
});