set_fields: Set fields inside a sendeR client

Description Usage Arguments Details Value Examples

View source: R/client_with_fields.R

Description

This function is intended to set default parameters such as message or destination inside a client as additional fields. After setting default values the clients will be able to send messages without passing additional arguments to the send_message function.

Usage

1
set_fields(client, ...)

Arguments

client

the client which will have default values set.

...

named arguments to set inside the client (non-named arguments will be ignored).

Details

Standard fields utilized in the package include:

any other set defaults won't have any effect.

Note: arguments to send_message function are always prioritized over the client fields.

Value

Updated client.

Examples

1
2
3
4
5
6
7
client <- client_telegram("my_token")
client <- set_fields(client, message = "Hello world!", destination = 12345)

## Not run: 
    send_message(client)

## End(Not run)

tmakowski/sendeR documentation built on June 27, 2020, 9 p.m.