RocketChat / Rocket.Chat.js.SDK

Utility for apps and bots to interact with Rocket.Chat via DDP and/or API
MIT License
136 stars 95 forks source link

getRoomIdByNameOrId not working for private rooms #21

Closed xvilo closed 6 years ago

xvilo commented 6 years ago

Using the easy bot example provided in the readme, I can not get getRoomIdByNameOrId for private rooms.

Sample debug info:

[received] Message in room c9rpqHsDJq6QP7bFA
[getRoomNameById] Calling (caching): c9rpqHsDJq6QP7bFA
[getRoomNameById] Success: "wanneer-gaan-we-naar-de-mac"
[getRoomIdByNameOrId] Calling (caching): wanneer-gaan-we-naar-de-mac
[getRoomIdByNameOrId] Error: { isClientSafe: true,
  error: 'error-not-allowed',
  reason: 'Not allowed',
  details: { method: 'getRoomIdByNameOrId' },
  message: 'Not allowed [error-not-allowed]',
  errorType: 'Meteor.Error' }

as you can see getRoomNameById works, but getRoomIdByNameOrId doesn't. Can some help me out or point me in the right direction here?

timkinnane commented 6 years ago

Tracked this issue back to core. Please comment there... https://github.com/RocketChat/Rocket.Chat/issues/11552