slackteams is a part of slackverse

slackcalls

↙️⬇️↘️
slackthreads
slackteams

⬅️➡️
slackblocks

⬇️
slackreprex

slackteams is an R package that allows the user to manage multiple Slack teams during a session.

Installation

remotes::install_github("yonicd/slackteams")

Create an Incoming Webhook

The following button will create a Slack incoming webhook with the correct scope to your Slack team.

Add to Slack

Button Directions

  1. Click the button
  2. Select the team to install the application
  3. Select the default channel to post to (this can be changed later)
  4. If successful a SLACK_KEY_ID will be returned. 👈 🚨 Keep this Key 🚨
  5. If not successful an error message will be returned.
  6. To keep the data safe you need your team MEMBERID to authenticate the SLACK_KEY_ID. How to locate your Member ID
  7. Paste the output into a json file. Default path that slackteams looks for the file is ~/.slackteams.

.slackteams

This is an example of the json file. Here we have 2 teams: slackr and r4ds. Each one contains a key (from slackr-app) and the paired user memberid.

{
  "slackr": {
    "key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "memberid": "UABC123"
  },
  "r4ds": {
    "key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "memberid": "UXYZ456"
  }
}

Basic Usage

library(slackteams)

Load the teams

slackteams::load_teams()

Activate a Team

slackteams::activate_team('r4ds')

Post a Message

slackblocks::block_text(text = 'my message')%>%
  slackblocks::post_block(channel = 'general')

Activate Another Team

slackteams::activate_team('slackr')

Post a Message

slackblocks::block_text(text = 'my other message')%>%
  slackblocks::post_block(channel = 'general')