Skip to content

Commit 5afcec4

Browse files
committed
update slack docs
1 parent 13bffc1 commit 5afcec4

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

docs/integrations/slack.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ interactions between the two: run code on Windmill by a Slack command or use the
55
Slack API directly from Windmill. In this guide, we'll cover both approaches, so
66
you can find the one that suits you best.
77

8-
![Integrattion between Slack and Windmill](../assets/integrations/slack-0-header.png "Connect Slack with Windmill")
8+
![Integration between Slack and Windmill](../assets/integrations/slack-0-header.png 'Connect Slack with Windmill')
99

1010
:::info
1111

1212
This guide assumes that you already have a Slack account and a workspace where
13-
you have admin rights. Some experience with Windmill helps, but not required.
13+
you have admin rights. For **self-hosted instances**, you will need to [setup oauth](../misc/2_setup_oauth/index.md) first.
1414

1515
:::
1616

@@ -59,10 +59,10 @@ editor and click "Save":
5959

6060
```typescript
6161
export async function main(response_url: string, text: string) {
62-
await fetch(response_url, {
63-
method: "POST",
64-
body: JSON.stringify({ text: `ROGER ${text}` }),
65-
});
62+
await fetch(response_url, {
63+
method: 'POST',
64+
body: JSON.stringify({ text: `ROGER ${text}` })
65+
});
6666
}
6767
```
6868

@@ -117,7 +117,6 @@ One simplier way to handle permissions is to host resources and variables on a f
117117

118118
![Share folder to group](../assets/integrations/slack-12-folder_to_group.png)
119119

120-
121120
:::
122121

123122
## Action on Slack from Windmill
@@ -152,12 +151,12 @@ and click "Next". Paste the following code in the editor and click "Test" - you
152151
should see the list of users and bots in your Slack workspace.
153152

154153
```typescript
155-
import { Resource } from "https://deno.land/x/windmill@v1.62.0/mod.ts";
156-
import { SlackAPI } from "https://deno.land/x/deno_slack_api@1.6.0/mod.ts";
154+
import { Resource } from 'https://deno.land/x/windmill@v1.62.0/mod.ts';
155+
import { SlackAPI } from 'https://deno.land/x/deno_slack_api@1.6.0/mod.ts';
157156

158-
export async function main(auth: Resource<"slack">) {
159-
const client = SlackAPI(auth.token);
160-
return await client.users.list();
157+
export async function main(auth: Resource<'slack'>) {
158+
const client = SlackAPI(auth.token);
159+
return await client.users.list();
161160
}
162161
```
163162

@@ -175,7 +174,6 @@ You can find a more complete version of this Script on
175174
We go deeper in a [further article](https://docs.windmill.dev/blog/handler-slack-commands), integrating multiple commands, resources and Slack approval steps.
176175
:::
177176

178-
179177
<!-- Links -->
180178

181179
[wm-slack-settings]: https://app.windmill.dev/workspace_settings?tab=slack

0 commit comments

Comments
 (0)