diff --git a/NAMESPACE b/NAMESPACE index fd1b2d5..982615c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,6 +4,7 @@ export(dslc_slack_channels) export(dslc_youtube_playlists) export(process_youtube) export(process_zoom) +export(remove_all_club_reminders) export(reset_the) export(slack_default_token) export(slack_set_token) diff --git a/R/slack.R b/R/slack.R index 65c08c6..2d593d9 100644 --- a/R/slack.R +++ b/R/slack.R @@ -100,6 +100,21 @@ slack_set_token <- function(key_name = "SLACK_API_TOKEN", keyring = NULL) { return(invisible(.keyring_try(key_name, keyring = keyring))) # nocov } +#' Remove Zoom reminders +#' +#' Remove Zoom reminders from Slack channels. +#' +#' @inheritParams dslc_slack_channels +#' @param channel_name The name of the channel from which reminders should be +#' removed. +#' @param min_age_minutes How old messages need to be (in minutes) to be +#' cleared. +#' @param max_msgs_to_check How many messages to fetch to check for Zoom +#' reminders. +#' @param slack_channels A data.frame of Slack channels. +#' +#' @return NULL (invisibly) +#' @keywords internal remove_slack_reminders <- function(channel_name, min_age_minutes = 55, max_msgs_to_check = Inf, @@ -230,6 +245,14 @@ dslc_book_club_channels <- function(token = slack_default_token(), dplyr::pull(.data$name) } +#' Remove Book Club Zoom reminders +#' +#' Clear Zoom reminders from Book Club Slack channels. +#' +#' @inheritParams remove_slack_reminders +#' +#' @return NULL (invisibly) +#' @export remove_all_club_reminders <- function(min_age_minutes = 55, token = slack_default_token(), slack_channels = dslc_slack_channels( diff --git a/man/remove_all_club_reminders.Rd b/man/remove_all_club_reminders.Rd new file mode 100644 index 0000000..0171e45 --- /dev/null +++ b/man/remove_all_club_reminders.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/slack.R +\name{remove_all_club_reminders} +\alias{remove_all_club_reminders} +\title{Remove Book Club Zoom reminders} +\usage{ +remove_all_club_reminders( + min_age_minutes = 55, + token = slack_default_token(), + slack_channels = dslc_slack_channels(token = token) +) +} +\arguments{ +\item{min_age_minutes}{How old messages need to be (in minutes) to be +cleared.} + +\item{token}{character, api token issued by slack} + +\item{slack_channels}{A data.frame of Slack channels.} +} +\value{ +NULL (invisibly) +} +\description{ +Clear Zoom reminders from Book Club Slack channels. +} diff --git a/man/remove_slack_reminders.Rd b/man/remove_slack_reminders.Rd new file mode 100644 index 0000000..0b6abe4 --- /dev/null +++ b/man/remove_slack_reminders.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/slack.R +\name{remove_slack_reminders} +\alias{remove_slack_reminders} +\title{Remove Zoom reminders} +\usage{ +remove_slack_reminders( + channel_name, + min_age_minutes = 55, + max_msgs_to_check = Inf, + token = slack_default_token(), + slack_channels = dslc_slack_channels(token = token) +) +} +\arguments{ +\item{channel_name}{The name of the channel from which reminders should be +removed.} + +\item{min_age_minutes}{How old messages need to be (in minutes) to be +cleared.} + +\item{max_msgs_to_check}{How many messages to fetch to check for Zoom +reminders.} + +\item{token}{character, api token issued by slack} + +\item{slack_channels}{A data.frame of Slack channels.} +} +\value{ +NULL (invisibly) +} +\description{ +Remove Zoom reminders from Slack channels. +} +\keyword{internal}