R/classify_post.R

Defines functions classify_post

classify_post <- function(block, text, channel){

  action <- 'no_thread'
    
  if(inherits(channel,'character') & !is.null(text)){

    action <- 'new_thread'
      
  }
  
  if(inherits(channel,'slackpost')){
    
    action <- 'existing_thread'
    
  }
  
  structure(block, class = c(class(block),action))

}
yonicd/slackreprex documentation built on Sept. 20, 2020, 3:54 a.m.