Closed topher200 closed 6 years ago
I would use server.slack.post_message
; there's an example in the github plugin: https://github.com/llimllib/limbo/blob/a6d8bc904ea100fa0295c370455a1f5a07dc681d/limbo/plugins/github.py#L333-L339
(closed by accident)
Thanks! Doing research on this question led me to the slack docs; I didn't realize that postMessage and RTM Message came straight from their lingo. For anyone else looking to know the difference between the two, I'd highlight these docs:
I'm trying to enumerate the differences between the two APIs i.r.t. Limbo. Does this look accurate? Anything you'd add?
Action | slack.rtm_send_message |
slack.post_message |
---|---|---|
Messages look like they're sent from your specific Bot user | Handled automatically | Requires kwarg: as_user=server.slack.username . Otherwise, the messages look like they came from a default, generic Bot user |
Complex messages | The RTM API only supports posting simple messages formatted using Slack's default message formatting mode. It does not support attachments or other message formatting modes | Provides more complex messages |
Nope, that looks completely accurate 💯
My question is in two parts:
I want to send a message while I'm "processing" the user's request. So I want the convo to be
What is the best way to send "message 1"? My best two candidates are
slack.rtm_send_message
andslack.post_message
. I don't see any examples in the existing plugins of sending an intermediate message. If you had to send an intermediate message, which would you use?If the answer to question 1 is
slack.rtm_send_message
, we should implement that function in FakeSlack so I can call it in tests. If the answer isslack.post_message
, then we don't need to bother.Looking at the two functions, it seems like
slack.post_message
takes more args and is possibly more configurable.limbo.py
also mentions something about using it to "sending messages from the loop hook". Based on the answers to all these questions, I think I'll add some documentation around exactly what those functions do, what they should be used for, and what makes them different.