@@ -5,12 +5,12 @@ interactions between the two: run code on Windmill by a Slack command or use the
5
5
Slack API directly from Windmill. In this guide, we'll cover both approaches, so
6
6
you can find the one that suits you best.
7
7
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 ' )
9
9
10
10
::: info
11
11
12
12
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 .
14
14
15
15
:::
16
16
@@ -59,10 +59,10 @@ editor and click "Save":
59
59
60
60
``` typescript
61
61
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
+ });
66
66
}
67
67
```
68
68
@@ -117,7 +117,6 @@ One simplier way to handle permissions is to host resources and variables on a f
117
117
118
118
![ Share folder to group] ( ../assets/integrations/slack-12-folder_to_group.png )
119
119
120
-
121
120
:::
122
121
123
122
## Action on Slack from Windmill
@@ -152,12 +151,12 @@ and click "Next". Paste the following code in the editor and click "Test" - you
152
151
should see the list of users and bots in your Slack workspace.
153
152
154
153
``` 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' ;
157
156
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 ();
161
160
}
162
161
```
163
162
@@ -175,7 +174,6 @@ You can find a more complete version of this Script on
175
174
We go deeper in a [ further article] ( https://docs.windmill.dev/blog/handler-slack-commands ) , integrating multiple commands, resources and Slack approval steps.
176
175
:::
177
176
178
-
179
177
<!-- Links -->
180
178
181
179
[ wm-slack-settings ] : https://app.windmill.dev/workspace_settings?tab=slack
0 commit comments