idkclub / dicebot

🎲 /roll support for Slack
https://dicebot.idk.club
The Unlicense
53 stars 20 forks source link

Thread roll #61

Closed elafontaine closed 3 years ago

elafontaine commented 4 years ago

Could the dicer bot make the roll in threads ? This would allow for clean sub-conversation rolls as well .

ie.

in a thread, /roll 2d6

arkie commented 4 years ago

I'd be happy to support this, but unfortunately Slack's documentation is extremely poor - this medium article (nominally from Slack) suggests that it's a possibility, but Slack's command documentation makes no mention of what permission to read and write messages actually maps to within the new OAuth infrastructure.

I tried the shotgun approach of adding several related permissions to the app for testing, but couldn't get it to respond with anything other than the following error 🙄

Screen Shot 2020-07-08 at 01 04 45

If you can find anything more useful, or can get it working within a test instance, I'd also be happy to accept a PR.

watson13j commented 3 years ago

I submitted a PR for this. I have zero experience writing slack bots, but it looks like all you need is to grab thread_ts from the message and make sure the response contains the same thread_ts payload. 🤷‍♂️

watson13j commented 3 years ago

Based on this: https://api.slack.com/methods/channels.replies

arkie commented 3 years ago

It looks like https://api.slack.com/methods/channels.replies is deprecated, and as noted on https://github.com/arkie/dicebot/pull/62, Slack isn't supporting commands in threads (or possibly in general, going forward? 😶)