```coffeescript
_ = require "underscore"
Fuse = require "fuse.js"

class Utils
  @robot: null

  @findRoom: (msg) ->
    room = msg.envelope.room
    if _.isUndefined(room)
      room = msg.envelope.user.reply_to
    room

  @getRoom: (context) ->
    room = @robot.adapter.client.rtm.dataStore.getChannelOrGroupByName context.message.room
    room = @robot.adapter.client.rtm.dataStore.getChannelGroupOrDMById context.message.room unless room
    room

  @getUsers: ->
    Utils.robot.adapter?.client?.rtm?.dataStore?.users or Utils.robot.brain.users()

  @lookupUserWithGithub: (github) ->
    return Promise.resolve() unless github

    findMatch = (user) ->
      name = user.name or user.login
      return unless name
      users = Utils.getUsers()
      users = _(users).keys().map (id) ->
        u = users[id]
        id: u.id
        name: u.name
        real_name: u.real_name

      f = new Fuse users,
        keys: ['real_name']
        shouldSort: yes
        verbose: no
        threshold: 0.55

      results = f.search name
      result = if results? and results.length >=1 then results[0] else undefined
      return Promise.resolve result

    if github.fetch?
      github.fetch().then findMatch
    else
      findMatch github

module.exports = Utils
```

Allow for discovery of users for DMs
user
```coffeescript
_ = require "underscore"
Fuse = require "fuse.js"

class Utils
  @robot: null

  @findRoom: (msg) ->
    room = msg.envelope.room
    if _.isUndefined(room)
      room = msg.envelope.user.reply_to
    room

  @getRoom: (context) ->
    room = @robot.adapter.client.rtm.dataStore.getChannelOrGroupByName context.message.room
    room = @robot.adapter.client.rtm.dataStore.getChannelGroupOrDMById context.message.room unless room
    room = @robot.adapter.client.rtm.dataStore.getDMByUserId context.message.room unless room
    room = @robot.adapter.client.rtm.dataStore.getDMByName context.message.room unless room
    room

  @getUsers: ->
    Utils.robot.adapter?.client?.rtm?.dataStore?.users or Utils.robot.brain.users()

  @lookupUserWithGithub: (github) ->
    return Promise.resolve() unless github

    findMatch = (user) ->
      name = user.name or user.login
      return unless name
      users = Utils.getUsers()
      users = _(users).keys().map (id) ->
        u = users[id]
        id: u.id
        name: u.name
        real_name: u.real_name

      f = new Fuse users,
        keys: ['real_name']
        shouldSort: yes
        verbose: no
        threshold: 0.55

      results = f.search name
      result = if results? and results.length >=1 then results[0] else undefined
      return Promise.resolve result

    if github.fetch?
      github.fetch().then findMatch
    else
      findMatch github

module.exports = Utils
```
assistant