mrkaye97 / slackr

An R package for sending messages from R to Slack
https://matthewrkaye.com/slackr/
Other
307 stars 83 forks source link

duration argument in slackr_history() is not respected if posted_from_time is not specified #181

Closed czeildi closed 1 year ago

czeildi commented 1 year ago

In slackr_history() the duration argument has no effect in contrast with the documentation if posted_from_time is not specified (which is the default).

I think the problem is in this line: https://github.com/mrkaye97/slackr/blob/master/R/slackr_history.R#L34 Instead of missing(posted_from_time) it should check if the posted_to_time is provided as the code and logic relies on that. The functions works as expected if I specify duration = "whatever dummy value"

Also I think the documentation could be improved as the default is not 24 hours, but no limit on the duration. https://github.com/mrkaye97/slackr/blob/master/R/slackr_history.R#L13

I am happy to prepare a PR if you are open to it.

mrkaye97 commented 1 year ago

hey @czeildi, thanks for the detailed bug report! sure thing, if you're up for putting in a fix I'd be happy to review it :)