Conversation
9b53f05 to
fffbce7
Compare
fffbce7 to
b4160d1
Compare
|
👍 😮 |
|
@dblock when is it going to be released? Any plan. |
|
I released 0.11.0. |
|
Thanks :) |
|
Hi, @alexagranov and @dblock . Trying to initiate a dialog in a workflow. How do I call the dialog.open method? |
|
You can’t spontaneously open a dialog like this. You can only open a dialog
in response to a message action (a button click or a menu selection) and
you have to use the `trigger_id` that comes along with the action payload
when you open the dialog. Check out the docs on dialogs for the full scoop.
…On Sun, Jan 28, 2018 at 4:02 PM Arnold™ ***@***.***> wrote:
Trying to initiate a dialog in a workflow. How do I call the dialog.open
method?
res = $client.im_open(user: user_id)
attachments = [{
dialog: [{
title: "Please provide the following details",
callback_id: "log:dialog",
submit_label: "Submit",
elements: [
{
type: "text",
label: "Starting Time",
name: "started",
value: "text",
hint: "What time did you start work?"
},
{
type: "text",
label: "Reason",
name: "reason",
value: "text",
hint: "Why were you late?"
}
]
}]
}]
$client.dialog_open(
channel: res.channel.id,
text: 'Got it. Thank you',
attachments: attachments.to_json
)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGh-bQhwUO8ECdcHgaDY-K4fmpXOOMTTks5tPOBhgaJpZM4PpUf0>
.
|
|
If indeed after you remove the extra nested The client already takes care of the |
|
Thanks @jmanian and @alexagranov for your response, much appreciated. Yes, the I have changed the dialog as per you advice to However, The error I am obtaining is |
|
Gentlemen, the undefined method issue was due to using a lower version of 'Slack-Ruby_Client'. Was on '0.9.1' instead of at least '0.11.0'. I have upgraded to '0.11.1'. Everything working great. Thanks very much. However, I seemed to encounter dialog validation errors when the title was too long. |
|
👍 Good to know there's a length limit! |
|
Yes, there is indeed a length limit and it is very difficult to troubleshoot those issues because current ruby-client will only raise error saying |
|
@vbanthia This would be useful, PR? |
We have Dialogs!!!
Note: I removed the auto-generated
spec/slack/web/api/endpoints/dialog_spec.rbas even though it passes, it's not technically accurate due to the necessary JSON patch - plus it's tests are already included in the custom dialog_spec.rb.