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

hubot script how to get Room name? #213

Closed
thinkeridea opened this issue May 24, 2017 · 10 comments
Closed

hubot script how to get Room name? #213

thinkeridea opened this issue May 24, 2017 · 10 comments

Comments

@thinkeridea
Copy link
Contributor

I try to use hubot control permissions, I think most hubot all function can be applied to join in the Room, but some will only respond to the designated person or Room, at this time I can get to the Room ID, but can't get Room Name, how should do?

@thinkeridea thinkeridea changed the title How to get Room name? hubot script how to get Room name? May 24, 2017
@geekgonecrazy
Copy link
Contributor

you'll need to access the getRoomId method on the adapter and pass the roomid to it. You'll need the bot role assigned to the user in rocket.chat for this function to work also.

@thinkeridea
Copy link
Contributor Author

This method can only obtain the roomId, but unable to get to the room name

@JigSawFr
Copy link

JigSawFr commented May 26, 2017

@thinkeridea i've the same problem, i'm unable to retrieve room name from a roomID.

getRoomId: (room) =>
		@tryCache _roomIdCache, 'getRoomIdByNameOrId', room, 'Room ID'

@geekgonecrazy as you can see you can obtain the RoomId by name or id, but if we want to get the room name from an id, there is not method for this in driver.

@thinkeridea
Copy link
Contributor Author

@JigSawFr I know simple increase Rocket. Chat service API can quickly realize demand, but I'm meteor is not very familiar with, the modified build always fail (perhaps China's firewall), also in trying to have some progress

@JigSawFr
Copy link

@thinkeridea yes, rocket api has a method to get info from a room by ID : https://rocket.chat/docs/developer-guides/rest-api/channels/info
And it's returning all info with it's name !

@thinkeridea
Copy link
Contributor Author

@JigSawFr I added the server methods getRoomNameById , maintain and present model is consistent, now also in testing availability, specific submission: thinkeridea/Rocket.Chat@231cdaa

@thinkeridea
Copy link
Contributor Author

@JigSawFr @geekgonecrazy My practice is successful, very convenient, hubot rocketchat adapter changes: thinkeridea@f84f504

image

@JigSawFr
Copy link

JigSawFr commented May 30, 2017

@thinkeridea, finally we have created a service (which use rocket chat api) for our scripts to have more needed functions as for example: getRoomNameById, sendPrivateMessage, etc.. detect room type etc..

@geekgonecrazy
Copy link
Contributor

@thinkeridea you rock! Looks like when 0.57.0 lands you will be able to simply call that method! :)

@thinkeridea
Copy link
Contributor Author

@JigSawFr @geekgonecrazy I implemented a simple hubot deployment script automatically, if interested can help add some functions, I will add more documents and assist in the next.
https://github.com/thinkeridea/hubot-gitlab-deploy

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

3 participants