This function takes the media_id of a post as well as one or more comment_ids and then deletes all of those comments

ig_comment_delete_bulk(media_id, comment_id, verbose = FALSE)

Arguments

media_id

numeric; the unique id to identify a post which can be found in the id, not the pk field, of posts returned via many of the functions retrieving feeds.

comment_id

numeric; the unique id to identify a post which can be found in the "id" on other comments returned via the Instagram API

verbose

logical; do you want informative messages?

Examples

last_post_media_id <- ig_my_timeline(paginate = FALSE)$id[1]
#> The rank_token is NULL in Rinstapkg's internal .state environment. This can occur if the user is authorized using OAuth 2.0, which doesn't require a rank_token, or the user is not yet performed any authorization routine. #> When/if needed, 'Rinstapkg' will initiate authentication and authorization. #> Or run ig_auth() to trigger this explicitly.
#> Error: Status: fail #> Message: login_required
comment_result1 <- ig_comment(last_post_media_id, comment_text = "New Comment #1")
#> Error in sprintf("media/%s/comment/", media_id): object 'last_post_media_id' not found
comment1_media_id <- comment_result1$comment$media_id
#> Error in eval(expr, envir, enclos): object 'comment_result1' not found
comment_result2 <- ig_comment(last_post_media_id, comment_text = "New Comment #2")
#> Error in sprintf("media/%s/comment/", media_id): object 'last_post_media_id' not found
comment2_media_id <- comment_result2$comment$media_id
#> Error in eval(expr, envir, enclos): object 'comment_result2' not found
deletion_result <- ig_comment_delete(last_post_media_id, c(comment1_media_id, comment2_media_id))
#> Error in sprintf("media/%s/comment/%s/delete/", media_id, comment_id): object 'last_post_media_id' not found