/
webhook-setup.Rmd
43 lines (34 loc) · 1.13 KB
/
webhook-setup.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
title: "Webhook Bot Setup"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Webhook Bot Setup}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
## Setup
Setting up the single-channel bot is simple.
1. Go to [https://api.slack.com/apps](https://api.slack.com/apps)
2. Click "Create New App" and then follow the setup instructions
3. Click "Incoming Webhooks" under "Features"
4. Turn the "Activate Incoming Webhooks" switch on
5. Click "Add New Webhook to Workspace"
6. Select the channel you'd like the bot to post to
7. Copy the Webhook URL
8. Call `slackr_setup(channel = '#channel_with_webhook', incoming_webhook_url = 'your_webhook')`. You can also follow the config file setup directions below instead of passing the channel and webhook directly.
And that's it! You should be able to post a message with `slackr_bot('test message')`
## Example Usage
```r
library(slackr)
slackr_setup()
slackr_bot('Test message',
channel = '#test',
username = 'mrkaye97',
icon_emoji = 'tada')
```