user_info: Fetch Slack User Info

View source: R/user.R

user_infoR Documentation

Fetch Slack User Info

Description

Get information about the logged-in user from the Slack API.

Usage

user_info(
  components = c("user_id", "real_name", "display_name", "pronouns", "user_name"),
  session = shiny::getDefaultReactiveDomain(),
  slack_api_key = session$userData$shinyslack_api_key,
  team_id = get_shinyslack_team_id(),
  shinyslack_key = Sys.getenv("SHINYSLACK_KEY")
)

Arguments

components

A character vector of user components to include. Current options are:

  • user_id: The ID used to uniquely identify this user on this Slack team.

  • real_name: The full name of this user as entered in their profile.

  • display_name: The name that the user has chosen to display to other users in Slack.

  • pronouns: The pronouns set by this user, if any.

  • user_name: You probably do not want this. It is a legacy piece of information.

session

The shiny session object. The default shiny::getDefaultReactiveDomain() is likely always sufficient outside of tests.

slack_api_key

The Slack API key to use. The default value should likely always be used outside of tests.

team_id

The Slack team ID through which the user is being authenticated.

shinyslack_key

(optional) A key to use to encrypt the string. If not set, the string is returned unencrypted.

Value

A shiny::reactive() with a named character vector.


r4ds/shinyslack documentation built on March 26, 2024, 4:26 a.m.