hipchat: Description: Communication with the hipchat API, including...

Description Usage Arguments Value See Also Examples

View source: R/message.R

Description

Description: Communication with the hipchat API, including sending messages to rooms, creating and destroying rooms, changing the topic, and manipulating and messaging users.

Send a message to a Hipchat room or user.

Usage

1
2
hipchat(room_or_user, message, notify = TRUE, color = "yellow",
  message_format = "text", api_token = hipchat_api_token())

Arguments

room_or_user

character or integer. The room(s) and/or user(s) to send a message to. Room and/or user IDs will also work, but you will first have to obtain the correct ID, so it is easier to user the former. Rooms can be specified by full name (e.g., "This room") and users can be specified by email (e.g., "some@user.org") or mention name (e.g., "@SomeUser").

If IDs are provided, they will be checked against the list of available room IDs. If the ID is present, a room ID will be assumed; otherwise, a user ID will be assumed.

message

character. The message(s) to send. If a message is over 10,000 characters, it will be split up into multiple messages, as the Hipchat API only allows up to 10,000 characters per message.

notify

logical. Whether or not to notify the target recipient. The default is TRUE, although FALSE is less invasive and useful for non-critical messages.

color

character. Available options are: yellow, red, green, purple, gray, or random. Defaults to yellow. If this is a message sent to a user, this option will be ignored.

message_format

character. Available options are: text or html. The default is text.

api_token

character. Optional API token. The default is hipchat:::hipchat_api_token(), which uses the environment variable HIPCHAT_API_TOKEN or the R option getOption('hipchat.api_token') if they are present.

Value

TRUE if the message was successfull, or an error otherwise.

See Also

hipchat_send

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
  hipchat('Some room', 'Hey guys!')
  hipchat('some@user.org', "Hey buddy how's it going?")
  hipchat('Some room', 'Server is down!', color = 'red')
  hipchat('Some room', 'Look at this picture: <img src="https://www.google.com/images/srpr/logo11w.png">', message_format = 'html')
 
  # A more comprehensive example
  hipchat(c("This room", 'and.this@user.org'), "Really important stuff", notify = TRUE,
    color = 'red', message_format = 'text', api_token = 'my_api_token')

## End(Not run)

robertzk/hipchat documentation built on May 27, 2019, 10:34 a.m.