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

Could you tell me how to find room_id easily? #16

Closed
1syo opened this Issue Oct 20, 2015 · 9 comments

Comments

Projects
None yet
2 participants
@1syo

1syo commented Oct 20, 2015

Thank you for good chat service and I have one question.

When I want to post message to idobata from hubot regularly,
I write script using node-cron moudle like this.

scripts/cron.coffee

cronJob = require('cron').CronJob
module.exports = (robot) ->
    new cronJob('0 0 8 * * *', () ->
        robot.send {room: 5586}, "Good morning."
    ).start()

The 5586 is room_id. I found room_id with debugging hubot-idobata adapter.
I think that I want to find it easily.

Could you tell me how to find room_id easily?
For instance, I will be able to find it on management console, or with calling API.

@1syo

This comment has been minimized.

Show comment
Hide comment
@1syo

1syo Oct 20, 2015

or, I want to post message with room name like this.

cronJob = require('cron').CronJob
module.exports = (robot) ->
    new cronJob('0 0 8 * * *', () ->
        robot.send {room: ‘general’} , "Good morning."
    ).start()

1syo commented Oct 20, 2015

or, I want to post message with room name like this.

cronJob = require('cron').CronJob
module.exports = (robot) ->
    new cronJob('0 0 8 * * *', () ->
        robot.send {room: ‘general’} , "Good morning."
    ).start()
@hibariya

This comment has been minimized.

Show comment
Hide comment
@hibariya

hibariya Oct 21, 2015

Member

Thank you for opening this issue.

Could you tell me how to find room_id easily?

Good question.
Unfortunately, for now, Idobata doesn't have the official way to get room_id.
I think that we have to announce information officialy for that.

For band-aid solution, let me show how to get room_id easily.

// (Visit the room, open brower's console and do this:)
var store = Ember.Application.byName('idobata').__container__.lookup('service:store');
var room = store.peekAll('room').find(function(room) {
  return (room.get('organization.slug') === 'THE_ORGANIZATION_SLUG' && room.get('name') === 'THE_ROOM_NAME'); });
room.get('id') // returns room_id

Please note that it is unofficial way and may be changed.

Member

hibariya commented Oct 21, 2015

Thank you for opening this issue.

Could you tell me how to find room_id easily?

Good question.
Unfortunately, for now, Idobata doesn't have the official way to get room_id.
I think that we have to announce information officialy for that.

For band-aid solution, let me show how to get room_id easily.

// (Visit the room, open brower's console and do this:)
var store = Ember.Application.byName('idobata').__container__.lookup('service:store');
var room = store.peekAll('room').find(function(room) {
  return (room.get('organization.slug') === 'THE_ORGANIZATION_SLUG' && room.get('name') === 'THE_ROOM_NAME'); });
room.get('id') // returns room_id

Please note that it is unofficial way and may be changed.

@1syo

This comment has been minimized.

Show comment
Hide comment
@1syo

1syo Oct 21, 2015

Thank you for your help!! 😸

1syo commented Oct 21, 2015

Thank you for your help!! 😸

@1syo

This comment has been minimized.

Show comment
Hide comment
@1syo

1syo Oct 21, 2015

I was able to get room_id.
Thank you. 😄

1syo commented Oct 21, 2015

I was able to get room_id.
Thank you. 😄

@hibariya

This comment has been minimized.

Show comment
Hide comment
@hibariya

hibariya Oct 21, 2015

Member

Yay, good for you 😃

Member

hibariya commented Oct 21, 2015

Yay, good for you 😃

@hibariya

This comment has been minimized.

Show comment
Hide comment
@hibariya

hibariya Oct 21, 2015

Member

For instance, I will be able to find it on management console, or with calling API.

Sounds good. I have added a pane about room_id into room-settings page right now.

selection_331

Member

hibariya commented Oct 21, 2015

For instance, I will be able to find it on management console, or with calling API.

Sounds good. I have added a pane about room_id into room-settings page right now.

selection_331

@1syo

This comment has been minimized.

Show comment
Hide comment
@1syo

1syo Oct 21, 2015

LGTM 👍🙆:suge-iine:💝🎉💡

1syo commented Oct 21, 2015

LGTM 👍🙆:suge-iine:💝🎉💡

@hibariya

This comment has been minimized.

Show comment
Hide comment
@hibariya

hibariya Oct 21, 2015

Member

😊 💃

Member

hibariya commented Oct 21, 2015

😊 💃

@hibariya

This comment has been minimized.

Show comment
Hide comment
@hibariya

hibariya Nov 16, 2015

Member

This is done, so I'm closing :)

Member

hibariya commented Nov 16, 2015

This is done, so I'm closing :)

@hibariya hibariya closed this Nov 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment