Giter VIP home page Giter VIP logo

slackteams's Introduction

slackteams

Lifecycle: experimental Covrpage Summary R-CMD-check Codecov test coverage

slackteams is a part of slackverse

slackcalls
slackthreads
slackteams
slackposts
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")

Tokens

Creating a token is simple using

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.

Basic Usage

library(slackteams)

Load the teams

slackteams::load_teams()
# The following teams are loaded:
#   slackr, R4ds

Activate a Team

slackteams::activate_team('R4ds')
# slack environment variables are set to 'R4ds' supplied definitions

Query Active Team Channels

slackteams::get_team_channels()

Query Active Team Members

slackteams::get_team_users()

Activate Another Team

slackteams::activate_team('slackr')
# slack environment variables are set to 'slackr' supplied definitions

slackteams's People

Contributors

actions-user avatar bkmgit avatar jonthegeek avatar yonicd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

slackteams's Issues

rate_limit Argument

Any functions that call post_slack, chat_slack, or files_slack should have a rate_limit argument (no default) which gets passed along.

Return token invisibly from add_team_code

As a slackteams + shiny user, I'd like to get the actual token used during add_team_code, so that I can set a cookie with that token (to make future auth easier).

Add Team via Token

As a shiny app, I'd like to add (and/or activate) a team using just a token, or maybe token + team name (although that's in the httr token, so, if we require that rather than just the string, the httr token will be enough).

This can be used by #11, but is also needed on its own (because the shiny app will handle the calls to generate the token).

Multiple Hits for Channels

  1. Create multiple private conversation channels on a slack team, each containing the same person (that person being you works fine).
  2. Post a block to a channel, using your username (not the actual channel ID).

Expected result: The message posts to the you-only channel.
Actual result: The message posts to whichever unnamed DM channel you joined first, which may or may not be the you-only channel, and gives you a warning about multiple matches.

I think this comes from row 124 of post.R. You need to make the search more specific, probably by enclosing "channel" in "^" and "$". But... it seems like slackteams should be dealing with this entirely, so I'm not certain what that code block is supposed to be doing.

Specify channel types

get_team_channels is the exported wrapper around the internal function get_conversations_list. get_conversations_list rightly has a "type" argument to restrict which types of channels we're getting, but the wrapper around get_conversations_list doesn't have that argument (and, in fact, calls get_conversations_list without arguments).

Looking at it more... I think that's probably right, for the case where we want to fully populate the team channels environment variable. But I think we should export get_conversations_list for advanced users who want to grab parts of the info (ie, for mentordash).

Gonna use ::: to try it out and make sure I can do what I want, and then I'll probably PR.

get_channel_info doesn't handle NA channel names

slackteams::get_channel_info("wins_and_feedback") errors on the R4DS slack. It appears get_team_channels sometimes returns a channel with an id but no name. This causes problems with the subsetting to determine id which then causes the switch to error.

In addition, could the function take a name xor an id?

Check .slack populators

I think there's still a legacy non-slackcalls call or two left in the thing that populates .slack$channels and/or .slack$users. I think this is currently much slower than it needs to be. Let's fix that.

It's possible I'm wrong, but I'm not able to confirm at the moment and wanted to log the thought.

scope yaml vignette

As a slackteams user, I'd like help setting up a yaml for custom scopes, so that I can semi-easily apply slackteams to an unexpected usecase.

Turn default path ~/slackr.json into a hidden file

Currently, the default configuration file is ~/slackr.json. This goes against the common practice of most (unix) tools to prefix their configuration files with a dot (like .bashrc, .vimrc, .user_profile etc.) so that they are hidden by most file explorers by default. So I think it would be great if we could add that "." as well, to not clutter a users home folder.

Allow user to supply their own slack app

As a power user, I'd like to supply my own client_id, client_secret, and redirect_url, so that I can deploy something that uses our authentication scheme.

The only use-case I have for this so far is a shiny app that logs in using our scheme (which isn't actually a thing yet, but should have an example soon in the form of mentordash). But once we have an example deployed, I can imagine others wanting to do something similar.

I think a slight refactor of add_team_interactive will allow this pretty easily. Just add ..., and pass the dots on to the httr auth (or, rather, probably pass it to an unexported function that deals with that/defaults to the package-internal settings if those aren't supplied).

Also add a vignette clearly describing how to do that, so nobody else has to decode this stuff like I have.

Add Team Interactively

As a user, I'd like to load a team interactively with an httr browser launch, so that I don't have to work too hard to get this set up.

This should always load the team into the .slack environment, but also (optionally) save a cached version for future loading.

Make sure that no downstream functions require the file (change them if they do).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.