Skip to contents

A generic function for posting messages to Slack channels via preconfigured webhooks.

By default, this sends a plain text message. Specialized methods (e.g. for objects of class pkg_news) can format and split messages more richly before posting.

Usage

slack_post(message, channel = c("github", "news"))

Arguments

message

A character string with the message body, or an object with a class that has its own slack_post() method (e.g. pkg_news).

channel

One of "github" or "news", selecting which Slack channel webhook to use.

Value

Invisibly returns NULL. Called for side effects.

See also

slack_post.pkg_news()

Examples

if (FALSE) { # \dontrun{
# Post a simple message
slack_post("Sync completed successfully", "github")

# Post parsed NEWS entries
news <- parse_pkg_news("packages/g6tr.md/NEWS.md", since_version = "0.3.2")
slack_post(news, "news")
} # }