knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Here are the ways you can use slackteams
to manage your slack teams.
To create a new token in an interactive session:
slackteams::add_team_interactive()
This will generate a minimal slack api token for you to interact with the slack. For more information on the different permissions the token can take refer to the Managing Tokens Vignette
The token team will be created, loaded and activated for you, so you can start working right away. To store this token for future sessions refer to Storing A Token.
If an environment variable SLACK_API_TOKEN is defined (eg .Renviron) then when the package is loaded or the namespace is attached slackteams
will load and activate that team and determine the team name associated with the api token.
The primary method that slackteams
loads and activates teams into the session is via a local JSON file. The assumed default location of the JSON file is ~/.slackteams
.
The contents of this file can contain multiple teams which you can activate during a session. Each field in the JSON contains the team name and the api token associated with it:
{ 'team_a': 'TOKEN_A', 'team_b': 'TOKEN_B' }
The teams are loaded using load_teams()
slackteams::load_team() The following teams are loaded: team_a, team_b
Once the teams are loaded then a team can be activated using activate_team()
slackteams::load_team('team_a') slack environment variables are set to 'team_a' supplied definitions
If you have a JSON file already created and want to add a team api token you can use slackteams::add_team
to manually update the slackteams environment with the new team.
slackteams::add_team(team = MY_NEW_TEAM, token = token)
If you want to store this information in your JSON file you can use, which will either update (teams that exists) or append (new teams) to the local JSON.
slackteams::slackteams(file = PATH_TO_JSON)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.