Skip to content
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 get DirectMessage #331

Open
seeramzan opened this issue Dec 19, 2019 · 0 comments
Open

Unable to get DirectMessage #331

seeramzan opened this issue Dec 19, 2019 · 0 comments

Comments

@seeramzan
Copy link

seeramzan commented Dec 19, 2019

Hi,

Please bear me because i am newbie

I am trying to send welcome message to new joined user. Message in channel is working fine but when i am trying to send the direct message i am getting following error

ERROR Unable to get DirectMessage Room ID: {"isClientSafe":true,"error":"error-not-allowed","reason":"Target user not allowed to receive messages","details":{"method":"createDirectMessage"},"message":"Target user not allowed to receive messages [error-not-allowed]","errorType":"Meteor.Error"} Reason: Target user not allowed to receive messages

I have given all the rights to user, i tried following line of codes and getting error on both.

robot.adapter.sendDirect({ user: { name: "user1"} }, "message here")
res.res.sendDirect "message here"

Problem what i observed is : Since user is not logged in that's why receiving this error. If a user is logged in and use that user then its sending the direct message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant