-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to send private message to user #159
Comments
Wow, I just came here to post the exact same bug, but in my case I'm trying to do it the following way (which works locally, but not in slack)
|
Also |
To send a DM you need the DM's ID and pass it as the Relevant code here, here, and here. If you respond to a message from a DM, it will automatically be sent back as a DM. |
@evansolomon Thanks for the suggestion. I've injected debug statements, and the logs suggest that |
If you're trying to send a DM to any arbitrary user, even users that haven't started a DM yet, this will depend on slackapi/node-slack-sdk#30 from the slack client. Hubot will need to open a DM channel, wait for the callback, then send the DM. I'll poke at this some. |
Doesn't look that way. We deployed hubot-slack from @1156fd60baa63de63e3c44aa1253c85e4b16b2b1, but the issue persists. |
|
Code I got working looked like: robot.send {room: message.envelope.user.name}, message I see a couple of folks passing objects with various user attributes, and as far as I know that won't work. The room attribute should be a string with the user's name. |
@jtatum Thanks for the hint! I've fixed it. :-D |
for those fighting with this in the future (as this is the hit for "hubot slack dm" on google
Works great. |
To clarify: DMs are considered rooms. With Slack, the DM room name is the user's username so either of these will work.
|
Those still fighting with this, should check out the workaround here: #332 (comment) The only thing that works currently to send DMs in Slack |
@contolini It appears that the |
If this is of any help, I was able to use the This was because I was using
|
FWIW, I'm able to accomplish this using the username w/ the preceding robot.messageRoom('@caseywebb', 'ping') |
I'm troubleshooting a TYPE ERROR when we try to send a private message to a user. The code looks like this:
This results in error:
Any help is appreciated.
The text was updated successfully, but these errors were encountered: