send_rocket_message: Send Rocket.chat messages to users, channels or groups

Description Usage Arguments Details Value Examples

View source: R/send_rocket_message.R

Description

send_rocket_message Uses the users ID and Token to communicate with Rocket.chat server and send messages to specific groups, users or channels

Usage

1
send_rocket_message(url, user_id, auth_token, receiver, message)

Arguments

url

The url of the rocket.chat server (has to be complete, with http or https).

user_id

The users ID retrieved from 'get_rocket_credentials'.

auth_token

The users authentication Token retrieved from 'get_rocket_credentials'.

receiver

The receiver of the message (if user mentioned with '@', otherwise use '#')

message

A text string containing the text to be sent

Details

This function connects with the Rocket.chat with users ID and Token and send a text message to a receiver.

To send a message to specific user, is essential to use the '@' before the user name. To send a message to groups or channels, you should use '#'

Value

This function has no return since it posts the message to the server

Examples

1
2
3
4
5
6
7
8
## Not run: 
send_rocket_message(url        = 'http://localhost:8000/',
                    user_id    = '<ROCKET_USER_ID>',
                    auth_token = '<ROCKET_USER_AUTH_TOKEN>',
                    receiver   = '#general',
                    message    = 'hello')

## End(Not run)

paeselhz/rocketeer documentation built on Nov. 11, 2019, 1:23 a.m.